Skip to content

Commit

Permalink
feat(decorations): use real tree sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuher committed Dec 29, 2024
1 parent 5cbc2ed commit eb1ad46
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/app/game/actors/decoration.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: [
{
Expand All @@ -42,7 +38,7 @@ export class Decoration extends Actor {
}
}),
useBounds: false,
offset: vec(0, - (shadowSize - treeSize))
offset: vec(0, -(shadowSize - treeSize))
},
{
graphic: new Sprite({
Expand All @@ -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());
}
Expand Down

0 comments on commit eb1ad46

Please sign in to comment.