Skip to content

Commit

Permalink
Merge pull request #5 from AshSimmonds/main
Browse files Browse the repository at this point in the history
player's collisionMask didn't react to spells
  • Loading branch information
danprince authored Nov 16, 2022
2 parents 1986b98 + d28fd8f commit 80e6052
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export function Die(object: GameObject, killer?: GameObject) {
.burst(2 + randomInt(3))
.remove();

object.onDeath(death);

for (let ritual of game.rituals) {
ritual.onDeath?.(death);
}
Expand All @@ -45,6 +43,8 @@ export function Die(object: GameObject, killer?: GameObject) {
game.addSouls(death.souls);
}

object.onDeath(death);

game.despawn(object);
}

Expand Down
4 changes: 1 addition & 3 deletions src/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ export function Player() {
player.onCollision = unit => {
Damage(player, unit.hp);
Die(unit);
if (player.hp <= 0) {
window.location = window.location;
}
};
player.onDeath = () => window.location = window.location;
return player;
}

Expand Down

0 comments on commit 80e6052

Please sign in to comment.