Changeset ebaddd9 in advance-wars for src/com/medievaltech/advancewars
- Timestamp:
- Feb 2, 2011, 3:36:46 AM (14 years ago)
- Branches:
- master
- Children:
- 6a639f7
- Parents:
- 5d77d43
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/advancewars/GameView.java
r5d77d43 rebaddd9 48 48 49 49 /** Paint to draw the lines on screen. */ 50 private Paint mLinePaint, mTextPaint, mButtonPaint, mTilePaint1, mTilePaint2, 50 private Paint mLinePaint, mTextPaint, mButtonPaint, mTilePaint1, mTilePaint2, mSelectionPaint, 51 51 mUnitPaint; 52 52 … … 60 60 61 61 private com.medievaltech.gui.Window wndMainMenu, wndBattleMap; 62 private Unit selectedUnit; 63 private boolean test = false; 62 64 63 65 public DrawingThread(SurfaceHolder surfaceHolder, Context context, Handler handler) { … … 94 96 mUnitPaint.setAntiAlias(true); 95 97 mUnitPaint.setARGB(255, 255, 0, 0); 98 99 mSelectionPaint = new Paint(); 100 mSelectionPaint.setAntiAlias(true); 101 mSelectionPaint.setARGB(255, 255, 127, 0); 96 102 97 103 wndMainMenu = new com.medievaltech.gui.Window(0, 0, 320, 450);; … … 112 118 for(int y=0; y<mMap.getHeight(); y++) { 113 119 if(land) 114 mMap.setTile(x, y, new Tile(grassTile ));120 mMap.setTile(x, y, new Tile(grassTile, new Point(x, y))); 115 121 else 116 mMap.setTile(x, y, new Tile(oceanTile ));122 mMap.setTile(x, y, new Tile(oceanTile, new Point(x, y))); 117 123 land = !land; 118 124 } … … 122 128 mMap.getTile(2, 3).addUnit(new Soldier(mUnitPaint)); 123 129 mMap.getTile(5, 7).addUnit(new Soldier(mUnitPaint)); 130 131 selectedUnit = mMap.getTile(2, 3).currentUnit; 124 132 125 133 mGameState = GameState.MAIN_MENU; … … 343 351 344 352 mMap.draw(canvas, 10, 25); 353 354 for(Point p : selectedUnit.getMovementRange()) { 355 canvas.drawRect(p.x*50+10, p.y*50+25, p.x*50+50+10, p.y*50+50+25, mSelectionPaint); 356 if(!test) 357 Log.i("AdvanceWars", "("+p.x+","+p.y+")"); 358 } 359 test = true; 345 360 346 361 text = "Advance Wars grid test";
Note:
See TracChangeset
for help on using the changeset viewer.