Skip to content

Commit

Permalink
fix: Ensure enemies move with slices when they bump into other slices
Browse files Browse the repository at this point in the history
If a slice is falling and hits another slice, we bump it up like a
"bounce". Ensure any enemies riding on the slice bump up with it,
otherwise, they snap into place when the slice finally lands.
  • Loading branch information
joshuacurtiss committed Jun 16, 2024
1 parent 05e4531 commit 380d919
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/objects/Slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export function slice(options: Partial<SliceCompOpt> = {}): SliceComp {
}
sliceBit.parent.fall(fallCount);
this.pos.y-=1.5
enemies.forEach(enemy=>enemy.pos.y-=1.5);
});
});
},
Expand Down

0 comments on commit 380d919

Please sign in to comment.