MCPcopy Create free account
hub / github.com/codemistic/Web-Development / update

Function update

Snake Game /food.js:7–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const EXPANSION_RATE = 5
6
7export function update() {
8 if (onSnake(food)) {
9 expandSnake(EXPANSION_RATE)
10 food = getRandomFoodPosition()
11 }
12}
13
14export function draw(gameBoard) {
15 const foodElement = document.createElement('div')

Callers

nothing calls this directly

Calls 3

onSnakeFunction · 0.90
expandSnakeFunction · 0.90
getRandomFoodPositionFunction · 0.85

Tested by

no test coverage detected