Skip to content

Commit

Permalink
Merge pull request #58 from digital-phantom-official/development
Browse files Browse the repository at this point in the history
Fix gameplay crash
  • Loading branch information
CrazyMarvin authored Mar 8, 2023
2 parents a4a83bf + 31dffb4 commit b8b31b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions core/src/app/halma/play/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;

public class Field extends Image {
//variables
Expand All @@ -33,6 +35,7 @@ public Field(Vector2 pos) {
this.addListener(listener);
this.setColor(baseColor);
}
private Set<Field> jumpedFields = new HashSet<>();
public Field(float x, float y) {
this(new Vector2(x,y));
}
Expand Down Expand Up @@ -91,6 +94,11 @@ public void showAllWays() {
jumpCount = 0;
}
public void jump(Field neighbour) {
if (jumpedFields.contains(neighbour)) {
jumpedFields.clear();
return;
}
jumpedFields.add(neighbour);
if(jumpCount>10_000) return;
jumpCount++;
LinkedList<Field> nextNeighbours = neighbour.neighbours; //die nachbarn von dem Feld, das besetzt ist
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Mar 08 14:10:23 PKT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit b8b31b0

Please sign in to comment.