Break out spawnable entities and use a registry to spawn them.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-13 20:07:44 +01:00
parent 7835a6051e
commit bca8d10964
10 changed files with 110 additions and 52 deletions

View File

@@ -0,0 +1,21 @@
enum EntityState { staticObj, idle, patrolling, shooting, pain, dead }
abstract class Entity<T> {
double x;
double y;
int spriteIndex;
double angle;
EntityState state;
int mapId;
int lastActionTime;
Entity({
required this.x,
required this.y,
required this.spriteIndex,
this.angle = 0.0,
this.state = EntityState.staticObj,
this.mapId = 0,
this.lastActionTime = 0,
});
}