Changeset bdd63ba in advance-wars for src/com/medievaltech/advancewars/GameView.java
- Timestamp:
- Jun 4, 2011, 6:55:31 PM (13 years ago)
- Branches:
- master
- Children:
- 379005b
- Parents:
- 113d7cf
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.