@Override public void Draw(ImageCollection batch) { for (Tile t : rangeSelectedTiles) { t.Draw(batch); CityGame.globalCount++; } if (isSelected) { // batch.fillRect(position, 32, 32, Color.blue, 2); // batch.drawRect(position, 32, 32, Color.blue, 100); batch.Draw(selection, position, 500); batch.DrawString( new Vector2(850, 15), "X:" + (position.getX() / 32 + 0.5) + ", Y:" + (position.getY() / 32 + 0.5), Color.black, direction); } if (rangeSelected) { batch.Draw(rSelectSprite, position, 500); } if (healthDisplay) { int h = (int) (health / maxHealth * 13); Image2D healthBar = new Image2D("Game Resources/Sprites/Status/Health/health" + h + ".png"); batch.Draw(healthBar, position, 505); } }
@Override public void unselect(Tile[][] t) { isSelected = false; for (Tile l : rangeSelectedTiles) { l.rangeUnselect(); } rangeSelectedTiles.clear(); }
@Override public void select(Tile[][] t) { isSelected = true; ArrayList<Tile> rt = getRangedTowers(t); for (Tile l : rt) { l.rangeSelect(); } rangeSelectedTiles.clear(); rangeSelectedTiles.addAll(rt); }