Create enemy type
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Phaser from "phaser";
|
||||
import { type World, type EntityId, type Vec2 } from "../core/types";
|
||||
import { type World, type EntityId, type Vec2, type ActorType } from "../core/types";
|
||||
import { TILE_SIZE } from "../core/constants";
|
||||
import { idx, isWall } from "../engine/world/world-logic";
|
||||
import { GAME_CONFIG } from "../core/config/GameConfig";
|
||||
@@ -264,7 +264,7 @@ export class DungeonRenderer {
|
||||
this.fxRenderer.showHeal(x, y, amount);
|
||||
}
|
||||
|
||||
spawnCorpse(x: number, y: number, type: "player" | "rat" | "bat") {
|
||||
spawnCorpse(x: number, y: number, type: ActorType) {
|
||||
this.fxRenderer.spawnCorpse(x, y, type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Phaser from "phaser";
|
||||
import { type EntityId } from "../core/types";
|
||||
import { type EntityId, type ActorType } from "../core/types";
|
||||
import { TILE_SIZE } from "../core/constants";
|
||||
import { GAME_CONFIG } from "../core/config/GameConfig";
|
||||
|
||||
@@ -109,7 +109,7 @@ export class FxRenderer {
|
||||
});
|
||||
}
|
||||
|
||||
spawnCorpse(x: number, y: number, type: "player" | "rat" | "bat") {
|
||||
spawnCorpse(x: number, y: number, type: ActorType) {
|
||||
const textureKey = type === "player" ? "warrior" : type;
|
||||
|
||||
const corpse = this.scene.add.sprite(
|
||||
|
||||
Reference in New Issue
Block a user