EdwardDunn / Platform-Game

Javascript/HTML platform game
MIT License
56 stars 78 forks source link

Enemy Killed Animation #54

Open EdwardDunn opened 6 years ago

EdwardDunn commented 6 years ago

Enemy Killed Animation

Currently when the player character jumps on an enemy character it falls off the screen.

Create an animation that makes the enemy character explode instead of falling away every time there is a collision.

There are a number of JQuery plugins to help with sprite animation.

skywalker212 commented 6 years ago

can we add a dissolving or fading effect?

antoschd commented 6 years ago

@EdwardDunn since we are jumping on the enemies, why not squeeze them and make them fall to the ground? This can be done, quit simple, by changing height and using the function hitBottom. I can do a pull-request if you like to.
animation awesome first game, by the way!

sseelbach commented 6 years ago

I don't think you can easily use the Jquery animation tools typical for CSS animation since the sprites are using the Canvas object - antoschd probably has the easiest method.

I couldn't find anything that felt like a cool death animation here: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Advanced_animations

EdwardDunn commented 6 years ago

@antoschd Great idea, Its nice and simple but really adds to the game play. If other contributors want to create a more advanced animation that is fine but this is a good start. Go ahead and create a PR for your change.

I will keep this issue open for anyone who wants to keep working on animations.