Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya246 authored Jun 24, 2021
1 parent 0397ede commit 96cfdf3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/routerSnakeMod/routerSnake.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ public void update(){
i += Time.delta;
if(i > 10f){
Call.label(routerSnakeMod.rout, length / 6f, x, y);
float[] oldSegment = segments.get(0);
segments.remove(0);
oldSegment[0] = x;
oldSegment[1] = y;
segments.add(oldSegment);
segments.add(new float[]{x, y});
while(segments.size < length){
segments.add(new float[]{x, y});
};
while(segments.size > length){
segments.remove(0);
};
if(x > routerSnakeMod.worldWidth){
heading = 180f;
}else if(x < 0f){
Expand Down Expand Up @@ -106,11 +109,11 @@ public void update(){
while(segments.size > length){
segments.remove(0);
};
newBuild.kill();
newBuild.damage(30);
}else{
length++;
segments.add(new float[]{x, y});
newBuild.kill();
newBuild.damage(30);
};
};
};
Expand Down

0 comments on commit 96cfdf3

Please sign in to comment.