iiitl / snake-game-js

0 stars 43 forks source link

Increase Snake Speed when Eating Food #2 #13

Closed rishyym0927 closed 5 months ago

rishyym0927 commented 5 months ago

Uploading Recording 2024-03-15 023052.mp4…

Hello @ANKITy102 , This is the pull request regarding Increase Snake Speed when Eating Food #2

Implemented feature to dynamically increase the speed of the snake by 0.1 units each time it consumes food. The increaseSpeed() function has been added to increment the speed, and it is called whenever the snake consumes food in the gameEngine() function. Additionally, the resetSpeed() function has been included to reset the speed to its initial value when the game is restarted. The existing comments and code structure have been preserved while integrating this new functionality.

ANKITy102 commented 5 months ago

@rishyym0927, reinititalize the speed variable on collision.