use of ca.hiphiparray.amazingmaze.FishCell.FishColour in project AmazingMaze by TheVirtualMachine.
the class Player method collectFish.
/** Handle the player collecting fish. */
private void collectFish() {
Rectangle thisBox = getBoundingRectangle();
for (int i = 0; i < maze.fishBoxes.size; i++) {
if (thisBox.overlaps(maze.fishBoxes.get(i))) {
TiledMapTileLayer layer = (TiledMapTileLayer) maze.map.getLayers().get(MapFactory.ITEM_LAYER);
int x = (int) maze.fishBoxes.get(i).x;
int y = (int) maze.fishBoxes.get(i).y;
FishColour colour = ((FishCell) layer.getCell(x, y)).getColour();
layer.setCell(x, y, null);
maze.fishBoxes.removeIndex(i);
switch(colour) {
case BLUE:
blueCollected++;
break;
case PURPLE:
purpleCollected++;
break;
case GREEN:
greenCollected++;
break;
case RED:
redCollected++;
break;
case ORANGE:
orangeCollected++;
break;
}
break;
}
}
}
Aggregations