Skip to content

Commit

Permalink
Something
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterCavespider committed Aug 12, 2016
1 parent 0a6a374 commit 98bdc19
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/nl/ibe/hex/app/GameNiftyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import nl.ibe.hex.game.IHexGame;
import nl.ibe.hex.game.IHexGameListener;
import nl.ibe.hex.supply.ColorSupplier;
import nl.ibe.hex.view.View;
import nl.ibe.hex.view.update.TickerListener;
import nl.ibe.hex.view.update.UpdateListener;
import nl.ibe.hex.view.update.UpdateProvider;
Expand Down Expand Up @@ -77,6 +78,8 @@ public void sync() {
Label currPl = nifty.getCurrentScreen().findNiftyControl("c_playerCurrent", Label.class);
currPl.setText(getPlayerInfo("current"));
}


}

public String getPlayerInfo(String type) {
Expand Down Expand Up @@ -125,6 +128,8 @@ public String getColor(String colorId) {
@Override
public void tickUpdate(double hertz) {
sync();

//((nl.ibe.hex.view.View) this.view).boardReset();
}

public void gameEnd(HexPlayer winner) {
Expand Down
4 changes: 2 additions & 2 deletions src/nl/ibe/hex/supply/ColorSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public static ColorRGBA getPlayerColor(Team team) {
//Bacteria

ColorRGBA color = SettingsHQ.Graphics.Colours.colour_bacteria.clone();
float g = Random.approximate(color.g, 0.2f);
float g = Random.approximate(color.g, SettingsHQ.Graphics.Colours.bac_distort);

color.g = g;
color.a = g;

return color;

Expand Down
2 changes: 1 addition & 1 deletion src/nl/ibe/hex/supply/ModelSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static Geometry getPlayerShape(Team team) {
mesh = new Box(0.35f, 0.35f, 0.35f);
} else if(team.getModelID().equals(1, "model")) {
//Bacteria
mesh = new Sphere(6, 6, 0.35f);
mesh = new Sphere(16, 16, 0.35f);
} else if(team.getModelID().equals(2, "model")) {
mesh = new Torus(8, 8, 0.05f, 0.35f);
}
Expand Down
16 changes: 10 additions & 6 deletions src/nl/ibe/hex/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,7 @@ public void onClick(HexSpatial hex) {
selected = false;

//Reset the colors
for (Map.Entry<HexCoordinate, HexSpatial> en : grid.grid.entrySet()) {
HexCoordinate key = en.getKey();
HexSpatial value = en.getValue();

value.setMaterial(MaterialSupplier.getColoredMaterial(ColorSupplier.getBoardColor()));
}
boardReset();


} else { //!selected
Expand Down Expand Up @@ -321,6 +316,15 @@ public void onClick(HexSpatial hex) {

}

public void boardReset() {
for (Map.Entry<HexCoordinate, HexSpatial> en : grid.grid.entrySet()) {
HexCoordinate key = en.getKey();
HexSpatial value = en.getValue();

value.setMaterial(MaterialSupplier.getColoredMaterial(ColorSupplier.getBoardColor()));
}
}

/**
* Checks if the player isn't null.
*
Expand Down

0 comments on commit 98bdc19

Please sign in to comment.