Skip to content

Commit

Permalink
🐛 fix exaggerated bounce from horizontal overlap with pad
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Dec 1, 2023
1 parent d69a9fb commit 4c94bc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ export default class Game extends Phaser.Scene {
this.pad!.body!.halfWidth + Math.round(avatar.container!.width / 2);
const score = ((halfWidth - pos) / halfWidth) * 100;

// horizontal overlap mid-frame but not a landing; bounce off
if (score < 0) {
drop.body.x += -drop.body.velocity.x;
drop.body.velocity.x *= -1;
return;
}
Expand Down

0 comments on commit 4c94bc2

Please sign in to comment.