Compare commits
2 commits
02e72795cc
...
e34c6c75bb
Author | SHA1 | Date | |
---|---|---|---|
e34c6c75bb | |||
c5b94b59c5 |
2 changed files with 4 additions and 1 deletions
BIN
assets/fire.png
BIN
assets/fire.png
Binary file not shown.
Before Width: | Height: | Size: 368 KiB After Width: | Height: | Size: 162 KiB |
|
@ -134,6 +134,9 @@ class SnekGame {
|
||||||
cellSize,
|
cellSize,
|
||||||
cellSize
|
cellSize
|
||||||
);
|
);
|
||||||
|
const putTileAnim=(x, y, tile) => putTile(x, y, tile[
|
||||||
|
Math.floor(Date.now()/1000*60+x+y)%tile.length
|
||||||
|
]);
|
||||||
const checkAdj=(x, y) => {
|
const checkAdj=(x, y) => {
|
||||||
let adj={};
|
let adj={};
|
||||||
adj.u=this.world[x][y-1];
|
adj.u=this.world[x][y-1];
|
||||||
|
@ -154,7 +157,7 @@ class SnekGame {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FIRE:
|
case FIRE:
|
||||||
putTile(x, y, fire[Math.floor(Date.now()/1000*60)%60]);
|
putTileAnim(x, y, fire);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HOLE:
|
case HOLE:
|
||||||
|
|
Loading…
Reference in a new issue