Skip to content

Commit

Permalink
Add yo moms house
Browse files Browse the repository at this point in the history
I overwrote everything previously on this branch because of graphics
rewrite
  • Loading branch information
Tony Brar committed May 27, 2016
1 parent 80dda40 commit 7222f2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/fictionalpancake/turbospork/GameConstants.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package fictionalpancake.turbospork;

public class GameConstants {
public static int PROTOCOL_VERSION = 11;
public static int PROTOCOL_VERSION = 14;

public static int NODE_RADIUS = 5;
public static double UNIT_RADIUS = 0.3;
public static double UNIT_MAX_DISTANCE = 1.25;
public static int HOUSE_NUM_CIRCLES = 6;
public static int FIELD_SIZE = 100;
public static int WIN_TEXT_SIZE = 10;
public static int GAMEREADY_TEXT_SIZE = 7;
Expand Down
4 changes: 3 additions & 1 deletion src/fictionalpancake/turbospork/paint/GameColors.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class GameColors {
};

public static Color getColorForOwner(int owner) {
if (owner < 0) {
if (owner == -3) {
return Color.BLACK;
} else if (owner < 0) {
return Color.LIGHT_GRAY;
} else if (owner < COLORS.length) {
return COLORS[owner];
Expand Down
11 changes: 10 additions & 1 deletion src/fictionalpancake/turbospork/paint/GraphicsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ public void paint(IPainter g) {
PaintStyle style = new PaintStyle();
style.color = GameColors.getColorForOwner(node.getOwner());
g.drawCircle(style, convertX(node.getX()), convertY(node.getY()), r);
drawNodeUnits(g, node);
// draw yo moms house
if (node.getOwner() == -3) {
Color purple = new Color(0x420666);
for (int circle = GameConstants.HOUSE_NUM_CIRCLES - 1; circle >= 0; circle--) {
style.color = ((circle % 2 == 0) ? Color.BLUE : purple);
g.drawCircle(style, convertX(node.getX()), convertY(node.getY()), (r / GameConstants.HOUSE_NUM_CIRCLES) * circle);
}
} else {
drawNodeUnits(g, node);
}
}
Node underMouse = getNodeUnderMouse(g);
if (underMouse != null) {
Expand Down

0 comments on commit 7222f2b

Please sign in to comment.