rubentd / tanks

Tanks battle game prototype, for nodejs learning purposes
95 stars 87 forks source link

Canvas instead of html + jquery ? #11

Open SwiTool opened 7 years ago

SwiTool commented 7 years ago

Hey,

I noticed a lack of performance here. Okay it is not the main purpose of the tutorial but we can't do html updates in a graphical game. What if you replace all of this by a canvas? I'm making my own tanks game, maybe you could inspirate from what i've done, later.

z3t0 commented 7 years ago

WebGl would be great, take a look at pixi.js I built a similar game with that.

SwiTool commented 7 years ago

Indeed it seems nice, I already heard about pixi.js, gonna look into this.

SwiTool commented 7 years ago

@z3t0 Check my fork here it's a non multiplayer for now, but I'm using PIXI.js and it shoes the basics (move, shoot, delimited area)

it's deisgned to have as many tanks as we want, each tank has different stats and bullet stats.

Please check it 😄

z3t0 commented 7 years ago

thanks i will @SwiTool

z3t0 commented 7 years ago

Also if you plan on adding multiplayer take a look here It uses pixi.js for rendering and another library for networking.

SwiTool commented 7 years ago

I use socket.io for networking. It is already multiplayer but it doesnt sync for now. I will make updates in a few days

z3t0 commented 7 years ago

Still worth checking out the networking library I'm using in that project as it does a lot heavy lifting including interpolation and prediction.

SwiTool commented 7 years ago

What is the name of it? I only see socket io

z3t0 commented 7 years ago

@SwiTool lance-gg

SwiTool commented 7 years ago

It seems hard to use. But if i encounter lags problems i'll bend over it. Thank you for the tip