diff options
Diffstat (limited to 'src/controller/entitycontext.ts')
-rw-r--r-- | src/controller/entitycontext.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/controller/entitycontext.ts b/src/controller/entitycontext.ts index c11c698..c1eb1fc 100644 --- a/src/controller/entitycontext.ts +++ b/src/controller/entitycontext.ts @@ -17,6 +17,7 @@ export class EntityContext implements CollidableGroup { return new EntityContext( renderer, + name, await loadEntity(renderer, entity), mkCollision(entity.collision), ); @@ -26,8 +27,9 @@ export class EntityContext implements CollidableGroup { private constructor( private readonly renderer: Renderer, + private readonly name: string, private readonly view: SpriteView, - public readonly collision: Collidable[], + private readonly collision: Collidable[], ) {} public render() { @@ -42,4 +44,8 @@ export class EntityContext implements CollidableGroup { public getCollidables(): Collidable[] { return this.collision; } + + public interact() { + alert(`You've interacted with ${this.name}!`); + } } |