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:
21
lib/features/entities/entity.dart
Normal file
21
lib/features/entities/entity.dart
Normal 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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user