new Controller(p_init, p_plane, p_snake)
Parameters:
| Name | Type | Description |
|---|---|---|
p_init |
Object | Should contain the attribute
keys (the keys to control the move direction of
the snake) and
speed (the speed of the snake).
foodInterval
(the interval within which some food for the
snake is placed on the field). |
p_plane |
$app$.game.snake.Plane | The plane where the snake has been placed. |
p_snake |
$app$.game.snake.Snake | The snake itself. |
- Source:
Methods
-
pauseGame()
-
Pauses the game.
- Source:
-
startGame()
-
Starts the game.
- Source:
-
stopGame()
-
Stops the game.
- Source: