Skip to content

Commit

Permalink
Fix death animation
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Nov 25, 2023
1 parent df05344 commit 36dac82
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/animation-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ export class AnimationManager {
Explosion.reset();
Explosion.strategy = ex.AnimationStrategy.End;
Explosion.scale = SCALE;
Explosion.events.once('ended', () => {
explosionActor.kill();
const sub = Explosion.events.on('frame', data => {
if (data.frameIndex === 7) {
explosionActor.kill();
sub.close();
}
});

explosionActor.graphics.use(Explosion);
Expand Down
5 changes: 4 additions & 1 deletion src/unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export class Unit extends ex.Actor {
this.actions.delay(500).callMethod(() => {
this.animationManger.playExplosion(this.pos);
Resources.ExplosionSound.play();
}).die()
}).callMethod(() => {
this.cell?.removeUnit(this);
this.kill();
});
}
}

Expand Down
13 changes: 7 additions & 6 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
## Gameplay
* [x] Start Screen
* [ ] Show the name of the stage "Gentle Plains"
* [ ] Show the players name when they should move
* [ ] Win condition
* [ ] Tutorial (what is the point of the game)
* [ ] Only show valid actions
* [x] Tutorial (what is the point of the game)
* [x] Only show valid actions
* [ ] Which units are mine?
* [ ] Show turn countdown
* [x] Smarter Enemy AI
Expand All @@ -17,16 +18,16 @@
## Audio

* [ ] Audio options
* [ ] Background music
* [ ] Better sound effects
* [x] Background music
* [x] Better sound effects
- hit sound effect
- death sound effect

## Selection

* [x] Right click to see enemy range
* [ ] Allow for gamepad/keyboard input too!
* [ ] Cursor? with arrow to hint that a player needs to do something
* [x] Allow for gamepad/keyboard input too!
* [x] Cursor? with arrow to hint that a player needs to do something
- Auto move the cursor to the first available unit?
* [ ] Arrow on path?

Expand Down

0 comments on commit 36dac82

Please sign in to comment.