Skip to content

Commit

Permalink
render buckets. increase game canvas size
Browse files Browse the repository at this point in the history
closes #3
  • Loading branch information
smpsnr committed Aug 5, 2015
1 parent 933ac93 commit 9db64a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void startGame(Level level) {
// Make sure the canvas is the correct width.
Stage stage = (Stage) root.getScene().getWindow();
canvas.widthProperty().set(stage.getWidth());
canvas.heightProperty().set(stage.getHeight() / 2);
canvas.heightProperty().set((stage.getHeight() / 2) * 1.75);

game = new Game(getGraphicsContext2D());
game.setLevel(level);
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/org/gamefolk/roomfullofcats/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,24 @@ public void drawSprites() {
bounds.getHeight());
}
}

for(int i = 0; i < buckets.length; i++) {

Bucket bucket = buckets[i];

if (bucket == null) {
continue;
}

FrameAnimation sprite = bucket.sprite;
Rectangle2D bounds = getCatBounds(i, (int) currentLevel.dimensions.height);
gc.drawImage(
sprite.getCurrentFrame(),
bounds.getMinX(),
bounds.getMinY(),
bounds.getWidth() + (bucket.things * 2),
bounds.getHeight() + (bucket.things * 2));
}
}

public void removeCat(double x, double y) {
Expand Down

0 comments on commit 9db64a2

Please sign in to comment.