🚀 smarter snake

This commit is contained in:
platane
2020-07-21 00:34:22 +02:00
parent 73bfce908e
commit fd9d7dadf6
6 changed files with 167 additions and 43 deletions

View File

@@ -12,11 +12,11 @@ const drawOptions = {
colorSnake: "purple",
};
const gameOptions = { maxSnakeLength: 5 };
const gameOptions = { maxSnakeLength: 5, colors: [1, 2, 3, 4] };
const gifOptions = { delay: 20 };
const grid = generateRandomGrid(42, 7, { colors: [1, 2, 3, 4], emptyP: 3 });
const grid = generateRandomGrid(42, 7, { ...gameOptions, emptyP: 3 });
const snake = [
{ x: 4, y: -1 },