source: advance-wars/src/com/medievaltech/advancewars/City.java

Last change on this file was 41c11dd, checked in by dportnoy <devnull@…>, 13 years ago

Added cities to the game, moved the map to a new static class, and added incomplete support for capturing cities with soldiers.

  • Property mode set to 100644
File size: 549 bytes
Line 
1package com.medievaltech.advancewars;
2
3import android.graphics.Canvas;
4import android.graphics.Point;
5
6public class City {
7 public Player owner;
8
9 public int maxHealth;
10 public int currentHealth;
11
12 public int sightRange;
13
14 public Point location;
15
16 public City() {
17 owner = null;
18 maxHealth = 10;
19 currentHealth = 10;
20 }
21
22 public void draw(Canvas c, int x, int y) {
23 if(owner == null)
24 c.drawRect(x-20, y-20, x+20, y+20, Player.neutralColor);
25 else
26 c.drawRect(x-20, y-20, x+20, y+20, owner.getColor());
27 }
28}
Note: See TracBrowser for help on using the repository browser.