Platform collision works
This commit is contained in:
parent
a0cc4ac0be
commit
24c7a78ae6
14 changed files with 1003 additions and 833 deletions
|
@ -10,18 +10,27 @@ public class GamePanel {
|
|||
|
||||
private Player player;
|
||||
|
||||
private Platform[] platforms;
|
||||
|
||||
public GamePanel(Window window, Camera camera) {
|
||||
this.window = window;
|
||||
this.camera = camera;
|
||||
|
||||
player = new Player(window, camera);
|
||||
|
||||
platforms = new Platform[] {
|
||||
new Platform(camera, 800, 800, 320)
|
||||
};
|
||||
}
|
||||
|
||||
public void update() {
|
||||
player.update();
|
||||
player.update(platforms);
|
||||
}
|
||||
|
||||
public void render() {
|
||||
for (int i = 0; i < platforms.length; ++i) {
|
||||
platforms[i].render();
|
||||
}
|
||||
player.render();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue