Platform collision works

This commit is contained in:
Gnarwhal 2024-08-07 05:02:56 +00:00
parent a0cc4ac0be
commit 24c7a78ae6
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174
14 changed files with 1003 additions and 833 deletions

View file

@ -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();
}
}