HF
This commit is contained in:
@@ -92,6 +92,7 @@ class Snake{
|
|||||||
const tileClone = this.tiles.map(tile => ({ ...tile }));
|
const tileClone = this.tiles.map(tile => ({ ...tile }));
|
||||||
this.tiles = []
|
this.tiles = []
|
||||||
|
|
||||||
|
// alle tiles nach vorne bewegen
|
||||||
tileClone.forEach((tile, i) => {
|
tileClone.forEach((tile, i) => {
|
||||||
const currentTile = { ...tile };
|
const currentTile = { ...tile };
|
||||||
if(i === 0){
|
if(i === 0){
|
||||||
@@ -110,7 +111,7 @@ class Snake{
|
|||||||
this.tiles.push(currentTile);
|
this.tiles.push(currentTile);
|
||||||
})
|
})
|
||||||
|
|
||||||
// Ändere nun geraden zu Kurven
|
// Ändere nun geraden zu Kurven wenn nötig
|
||||||
this.tiles.forEach((tile, i) => {
|
this.tiles.forEach((tile, i) => {
|
||||||
if(i === 0 || i === (this.tiles.length - 1)) return;
|
if(i === 0 || i === (this.tiles.length - 1)) return;
|
||||||
const before = this.tiles[i - 1];
|
const before = this.tiles[i - 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user