Skip to content

Commit

Permalink
Latest
Browse files Browse the repository at this point in the history
  • Loading branch information
NideBruyn committed Mar 14, 2021
1 parent ed1e89c commit 66126a0
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Galago/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jnlp.signing.keystore=
main.class=edu.berkeley.jmescher.Example
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=true
platform.active=default_platform
platform.active=JDK_1.8
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,11 @@ protected GameListMessage assembleGameListMessage() {
for (Iterator<NetworkGame> iterator = games.values().iterator(); iterator.hasNext();) {
NetworkGame game = iterator.next();
messages[i] = new NetworkGameMessage(game.getGameId(), game.getGameName());
if (game.getPlayers().size() >= game.getSpawnPoints().size()) {
messages[i].setFull(true);
} else {
messages[i].setFull(false);
}
i++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public abstract class SimplePhysics2DPlayer {
protected Vector3f startPosition;
protected int lives = 0;
protected int score = 0;
protected int maximumLives = 3;

public SimplePhysics2DPlayer(SimplePhysics2DGame physicsGame) {
this.game = physicsGame;
Expand Down Expand Up @@ -76,7 +77,7 @@ public int getLives() {
}

public boolean addLife() {
if (lives < 3) {
if (lives < maximumLives) {
lives ++;
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class NetworkGameMessage extends AbstractMessage {
private String gameId;
private String gameName;
private boolean active;
private boolean full;

public NetworkGameMessage() {
}
Expand Down Expand Up @@ -50,5 +51,13 @@ public boolean isActive() {
public void setActive(boolean active) {
this.active = active;
}

public boolean isFull() {
return full;
}

public void setFull(boolean full) {
this.full = full;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ public void addCollisionShape(CollisionShape collisionShape) {
this.body.addFixture(bodyFixture);

}

/**
* This will remove a body fixture from the body object
* @param collisionShape
*/
public void removeCollisionShape(CollisionShape collisionShape) {
this.bodyFixture = collisionShape.getBodyFixture();
this.body.removeFixture(bodyFixture);

}

public void setCollisionShape(CollisionShape collisionShape) {
this.collisionShape = collisionShape;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.jme3.export.Savable;
import com.jme3.math.Vector3f;
import java.io.IOException;
import org.dyn4j.dynamics.BodyFixture;
import org.dyn4j.geometry.Convex;

/**
Expand All @@ -23,6 +24,7 @@ public abstract class CollisionShape implements Savable {
protected Vector3f scale = new Vector3f(1, 1, 1);
protected Vector3f location = new Vector3f(0, 0, 0);
protected float margin = 0.0f;
protected BodyFixture bodyFixture;

public CollisionShape() {
}
Expand Down Expand Up @@ -66,4 +68,14 @@ public void read(JmeImporter im) throws IOException {
// this.scale = (Vector3f) capsule.readSavable("scale", new Vector3f(1, 1, 1));
// this.margin = capsule.readFloat("margin", 0.0f);
}

public BodyFixture getBodyFixture() {
return bodyFixture;
}

public void setBodyFixture(BodyFixture bodyFixture) {
this.bodyFixture = bodyFixture;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:\Backups\workspaces\galago\GalagoSuperPlatformerBros2D\nbproject\project.properties

0 comments on commit 66126a0

Please sign in to comment.