A Classic snake game built using HTML Canvas and javascript. Auto Play mode is implemented using greedy algorithm.
http://kirans08.github.io/snake/
initSnake(updateInterval, currentScore, currentLevel, levelFoods, foodScore, auto)
- updateInteral : Refresh interval in ms. Determines the speed of the game
- currentScore : Starting score.
- currentLevel : Starting level.
- levelFoods : No of foods for a level.
- foodScore : Score obtained for eating a food item.
- auto : Set to true for AI mode and false for Manual mode.
- Set the parameters as required, if none specified default values will be taken
- Modify the initSnake() in updateLevel() to set how difficulty increases in each level.
These default values are used for testing the auto play.
- updateInteral : 1
- currentScore : 0
- currentLevel : 1
- levelFoods : 1000
- foodScore : 10
- auto : true
##initBoard(blockSize, updateRate)
- blockSize: Size of a game cell in pixel.
- updateRate: Rate at which the speed of the game increases.
- Set the parameters as required, if none specified default values will be taken
- blockSize: 20
- updateRate: 2
- Use W A S D for navigation in manual mode
- Use Space bar for pause/resume