Skip to content

Commit 79cec37

Browse files
committed
Fixed remove of apple.
1 parent 28e05f0 commit 79cec37

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

arena.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class Apple{
152152
return ID;
153153
}
154154
this.remove = ()=>{
155-
Apple.#placedApples.splice(Apple.#placedApples.indexOf(this), 1);
155+
Apple.#placedApples.splice(Apple.#placedApples.indexOf(space), 1);
156156
}
157157
}
158158
}
@@ -467,9 +467,12 @@ function tick(){
467467
}
468468
switch(_settings.rules.apples){
469469
case 'FourSymmetry':
470+
console.log('space.getEatables().apple');
470471
while(0 < retries && Apple.getPlacedApples().length < 4){
471472
retries--;
472473
Apple.getPlacedApples().forEach(space => {
474+
console.log(space.getEatables().apple);
475+
debugger
473476
space.toggleApple();
474477
});
475478
let layer = Math.floor(Math.random()*_arena.length);

0 commit comments

Comments
 (0)