Changeset bdd63ba in advance-wars
- Timestamp:
- Jun 4, 2011, 6:55:31 PM (13 years ago)
- Branches:
- master
- Children:
- 379005b
- Parents:
- 113d7cf
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/advancewars/GameView.java
r113d7cf rbdd63ba 464 464 int y = ((int)event.getY() - thread.mMap.offset.y) / 50; 465 465 466 thread.selectedUnit = thread.mMap.getTile(x, y).currentUnit; 466 Unit target = thread.mMap.getTile(x, y).currentUnit; 467 468 if(thread.selectedUnit != null && thread.selectedUnit.getMovementRange().contains(new Point(x, y))) { 469 if(target == null || target == thread.selectedUnit) { 470 thread.mMap.getTile(thread.selectedUnit.location.x, thread.selectedUnit.location.y).removeUnit(); 471 thread.mMap.getTile(x, y).addUnit(thread.selectedUnit); 472 }else { 473 // the target contains another unit. If the unit is enemy-controlled, attack it 474 } 475 thread.selectedUnit = null; 476 }else 477 thread.selectedUnit = target; 467 478 } 468 479 -
src/com/medievaltech/advancewars/Tile.java
r113d7cf rbdd63ba 37 37 } 38 38 39 public void removeUnit( Unit unit) {39 public void removeUnit() { 40 40 if(currentUnit != null) { 41 41 currentUnit = null;
Note:
See TracChangeset
for help on using the changeset viewer.