Changeset b97a618 in advance-wars for src/com/medievaltech/game/Map.java
- Timestamp:
- Feb 2, 2011, 4:51:03 PM (14 years ago)
- Branches:
- master
- Children:
- 78d3c6f
- Parents:
- 6a639f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/game/Map.java
r6a639f7 rb97a618 6 6 public class Map { 7 7 private Tile[][] grid; 8 public Point offset; 8 9 9 public Map(int width, int height ) {10 public Map(int width, int height, Point offset) { 10 11 grid = new Tile[width][height]; 12 this.offset = offset; 11 13 } 12 14 13 public Map(Tile t, int width, int height ) {15 public Map(Tile t, int width, int height, Point offset) { 14 16 grid = new Tile[width][height]; 17 this.offset = offset; 15 18 16 19 for(int x=0; x<getWidth(); x++) … … 39 42 } 40 43 41 public void draw(Canvas c , int xStart, int yStart) {44 public void draw(Canvas c) { 42 45 for(int x=0; x<getWidth(); x++) 43 46 for(int y=0; y<getHeight(); y++) 44 grid[x][y].draw(c, xStart+50*x, yStart+50*y); 47 grid[x][y].draw(c, offset.x+50*x, offset.y+50*y); 48 } 49 50 public void drawUnits(Canvas c) { 51 for(int x=0; x<getWidth(); x++) 52 for(int y=0; y<getHeight(); y++) 53 grid[x][y].drawUnit(c, offset.x+50*x, offset.y+50*y); 45 54 } 46 55 }
Note:
See TracChangeset
for help on using the changeset viewer.