core: add Snake using Typescript #7
@ -81,7 +81,7 @@ class SnakeCore {
|
||||
}
|
||||
|
||||
reset() {
|
||||
console.log("[LOG] Reset was triggered");
|
||||
console.debug("[TRACE] Reset was triggered");
|
||||
this.gameover = false;
|
||||
this.foodAte = true;
|
||||
for (let i = 0; i < this.height; i++) {
|
||||
@ -105,6 +105,7 @@ class SnakeCore {
|
||||
foodRegen() {
|
||||
if (!this.foodAte)
|
||||
return;
|
||||
console.debug("[TRACE] Food reset was triggered");
|
||||
this.foodAte = false;
|
||||
while (true) {
|
||||
let tmp = new Point(Math.floor(Math.random() * this.width), Math.floor(Math.random() * this.height));
|
||||
|
Loading…
Reference in New Issue
Block a user