From eb1ad46ec1b2bd26b4235a1f75c86f50c18418a9 Mon Sep 17 00:00:00 2001 From: Mathieu Hermann Date: Sun, 29 Dec 2024 14:07:26 +0100 Subject: [PATCH] feat(decorations): use real tree sprite --- src/app/game/actors/decoration.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/app/game/actors/decoration.ts b/src/app/game/actors/decoration.ts index cec621d..fe63cb8 100644 --- a/src/app/game/actors/decoration.ts +++ b/src/app/game/actors/decoration.ts @@ -1,14 +1,12 @@ import { Actor, - type Engine, type Vector, vec, GraphicsGroup, CircleCollider, ColliderComponent, CollisionType, - Sprite, - Color + Sprite } from 'excalibur'; import { ScreenManager } from '../utils/screen-manager'; import { Resources } from '../resources'; @@ -24,13 +22,11 @@ export class Decoration extends Actor { height: treeSize, width: treeSize, collisionType: CollisionType.Active, - z: treeSize, - color: Color.Pink + z: treeSize }); this.collider = new ColliderComponent(new CircleCollider({ radius: treeSize })); - /* const graphicsGroup = new GraphicsGroup({ members: [ { @@ -42,7 +38,7 @@ export class Decoration extends Actor { } }), useBounds: false, - offset: vec(0, - (shadowSize - treeSize)) + offset: vec(0, -(shadowSize - treeSize)) }, { graphic: new Sprite({ @@ -58,17 +54,9 @@ export class Decoration extends Actor { }); this.graphics.use(graphicsGroup); - */ - this.listenExitViewportEvent(); } - override update(): void { - if (ScreenManager.isNearScreen(this, this.scene!.camera) && !this.children?.length) { - // this.buildSpectators(); - } - } - private listenExitViewportEvent(): void { this.on('exitviewport', () => this.checkForKill()); }