Skip to content

Commit

Permalink
Push player when blocking boss
Browse files Browse the repository at this point in the history
  • Loading branch information
ibillingsley committed Aug 23, 2022
1 parent 4b34f7c commit a1f04b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ const Snake = struct {
self.kill();
} else if (player.collideBlock(self.pos, radius)) {
const bump = std.math.max(11 - distance, 1.5);
self.pos.x += player.look_dir.x * bump;
self.pos.y += player.look_dir.y * bump;
player.pos.x -= player.look_dir.x * bump;
player.pos.y -= player.look_dir.y * bump;
self.speed.reflect(player.look_dir);
sound(500, toneDur(0, 0, 0, 3), sound_vol * 0.3, w4.TONE_NOISE);
} else if (player.collideBody(self.pos, radius)) {
Expand Down

0 comments on commit a1f04b5

Please sign in to comment.