PalashBansal / Pacman

Game based on collision detection in Javascript
http://palashbansal.github.io/Pacman
MIT License
3 stars 4 forks source link

Make food bounce by obstacles #62

Open PalashBansal opened 2 years ago

PalashBansal commented 2 years ago

Grabbing food is quite easy sometimes, can make it interesting by bouncing it off whenever any obstacle hits it.

Bouncing must happen with good speed and slowly decrease to 0 i.e. resting state. The direction of movement of food must be determined by where the obstacle is hitting it.

Optional: Bounce speed can vary based on which obstacle hits, a bigger obstacle creates better momentum.

Note: It may happen that 2 obstacles are hitting the food one after other, in that case, food must bounce in different direction.