Jack's Game: snake

my games
Games: flappy-bird game snake
circle1 cube1
Texture
self.getX()/getY()/setX()/setY() · move it  |  self.setColor('red') · change its color  |  self.setTexture('patterns/checker.png') · pick a texture, or null for plain color  |  self.isTouching('circle1') · true every frame while overlapping  |  self.isTouchingOnce('circle1') · true once, the frame contact starts  |  Game.getShape('circle1').health -= 1 · read/change another shape's stuff  |  Game.spawnShape('circle', x, y, 'red') · create a new shape, returns its id  |  keys.left/right/up/down/space · held down (smooth movement)  |  keys.leftPressed/rightPressed/... · just pressed once (hop movement, like Frogger)  |  UI.showMessage('Game Over!') · popup + freeze  |  UI.showButton('Play Again', Game.restart) · clickable button  |  UI.drawText('Health: 100', 20, 20) · call every frame to keep it showing  |  Game.restart() · reset to starting positions
students/jack/snake.php open in new tab