This commit is contained in:
2026-05-15 20:35:41 +02:00
parent 1346dba937
commit 1b427c8679
12 changed files with 77 additions and 17 deletions

View File

@@ -1,12 +1,12 @@
import Phaser from "phaser";
export class Platform extends Phaser.GameObjects.Rectangle {
static readonly COLOR = 0x4a7c3a;
export class Platform extends Phaser.GameObjects.TileSprite {
static readonly TEXTURE_KEY = "platform";
declare body: Phaser.Physics.Arcade.StaticBody;
constructor(scene: Phaser.Scene, x: number, y: number, width: number, height: number) {
super(scene, x, y, width, height, Platform.COLOR);
super(scene, x, y, width, height, Platform.TEXTURE_KEY);
scene.add.existing(this);
scene.physics.add.existing(this, true);
}