mirror of
https://codeberg.org/ashley/poke
synced 2025-05-30 02:59:43 +00:00
oops
This commit is contained in:
parent
6268bdebfb
commit
547f68c882
@ -427,8 +427,8 @@
|
|||||||
// Game state
|
// Game state
|
||||||
let snake, dir, food, score, highScore = 0, level, gameInterval;
|
let snake, dir, food, score, highScore = 0, level, gameInterval;
|
||||||
let state = 'start'; // 'start', 'playing', 'gameover'
|
let state = 'start'; // 'start', 'playing', 'gameover'
|
||||||
const funnyMessages = [
|
const endMessages = [
|
||||||
"You got scaled!", "Snake bit ya!", "Sssorry, try again!", "Slither fail!", "Curveball!"
|
"Skill issue!", "Snake bit ya!", "Sssorry, try again!",
|
||||||
];
|
];
|
||||||
|
|
||||||
function resizeCanvas() {
|
function resizeCanvas() {
|
||||||
@ -518,7 +518,7 @@
|
|||||||
function endGame() {
|
function endGame() {
|
||||||
clearInterval(gameInterval);
|
clearInterval(gameInterval);
|
||||||
state = 'gameover';
|
state = 'gameover';
|
||||||
gameOverText.textContent = funnyMessages[Math.floor(Math.random()*funnyMessages.length)];
|
gameOverText.textContent = endMessages[Math.floor(Math.random()*endMessages.length)];
|
||||||
gameOverScreen.classList.remove('hidden');
|
gameOverScreen.classList.remove('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user