owenashurst / agar.io-clone

Agar.io clone written with Socket.IO and HTML5 canvas
MIT License
2.88k stars 1.12k forks source link

Adding animations? #28

Open huytd opened 9 years ago

huytd commented 9 years ago

I'm thinking about adding an animation engine for handling some animation (split animation,...) and for faster HitTest.

But have no idea where should we calculate the animation. On server side (more complex) or on client side (much easier? any risk?)

EDIT: Appended #134

"... noticed when you eat the "food" the transition between your current size and the next size is instantaneous. Could you add the transition of the "expansion" from your current size to the new size?"

pepzwee commented 9 years ago

Animations and physics can be done client side. Anything that is not cosmetic like the splitting action itself should be server side but the client can handle the animations.

huytd commented 9 years ago

Yes, I think this much better for server and will not affect game performance.

HansMusterWhatElse commented 9 years ago

Physic engine should definitely not be applied on the client - that's actually one of the most important parts of the game and should be handled only by the server. Take a look at the following link, games like angry birds rely heavily on the box2d engine, which is also available in JavaScript. http://box2d-js.sourceforge.net/

MrJerB commented 9 years ago

Probably obvious but hit-detection needs to remain on the server-side.

abalabahaha commented 8 years ago

I think this title makes more sense. Physics is more of the movement stuff and should always be on the server-side to guard against Inspect Element hackers, animations is more of the client-side transitions (cell growth, smoother movement, smoother eating, etc.)