Skip to content

luizrabachini/snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

Plugin to add a secret snake game in html pages using canvas.

The game is activated by Konami Code.

Live demo available in luizrabachini.com

Usage

<script src="snake-game-min.js"></script>
<script>
	snakeGame = new SnakeGame();
	snakeGame.init();
</script>

Customization

config = {
	cellSize:10, // Size of grid cells
	cellPadding:1, // Padding of grid cell (must be less than cellSize / 2)
	initialLen:5, // Initial len of snake (number of initial nodes)
	moveInterval:20, // Interval between snake movements (in ms)
	nodeColor:'rgba(0, 0, 0, 0.3)' // Color of snake nodes
};
snakeGame = new SnakeGame();
snakeGame.init(config);

About

Plugin to add secret snake game in html pages using canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published