Add gun to inventory that fires bullets

This commit is contained in:
Peter Stockings
2026-01-20 21:31:21 +11:00
parent 1713ba76de
commit bac2c130aa
5 changed files with 263 additions and 7 deletions

View File

@@ -11,6 +11,28 @@ export class FxRenderer {
this.scene = scene;
}
showFloatingText(x: number, y: number, message: string, color: string) {
const screenX = x * TILE_SIZE + TILE_SIZE / 2;
const screenY = y * TILE_SIZE;
const text = this.scene.add.text(screenX, screenY, message, {
fontSize: "14px",
color: color,
stroke: "#000",
strokeThickness: 2,
fontStyle: "bold"
}).setOrigin(0.5, 1).setDepth(200);
this.scene.tweens.add({
targets: text,
y: screenY - 30,
alpha: 0,
duration: 1000,
ease: "Power1",
onComplete: () => text.destroy()
});
}
clearCorpses() {
for (const sprite of this.corpseSprites) {
sprite.destroy();