Skip to content

Commit

Permalink
Tweak shield bump distance
Browse files Browse the repository at this point in the history
  • Loading branch information
ibillingsley committed Aug 25, 2022
1 parent df929e8 commit 04d40f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Binary file modified dist/one-slime-army.wasm
Binary file not shown.
6 changes: 4 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const Cannon = struct {
if (player.collideAttack(self.pos, 7)) {
self.kill();
} else if (player.collideBlock(self.pos, 3)) {
const bump = std.math.max(11 - distance, 1.5);
const bump = std.math.max(11.5 - distance, 1.5);
self.pos.x += player.look_dir.x * bump;
self.pos.y += player.look_dir.y * bump;
self.speed.reflect(player.look_dir);
Expand Down Expand Up @@ -420,9 +420,11 @@ const Snake = struct {
if (player.collideAttack(self.pos, radius)) {
self.kill();
} else if (player.collideBlock(self.pos, radius)) {
const bump = std.math.max(11 - distance, 1.5);
const bump = std.math.max(8.5 + radius - distance, 1.5) / 2;
player.pos.x -= player.look_dir.x * bump;
player.pos.y -= player.look_dir.y * bump;
self.pos.x += player.look_dir.x * bump;
self.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
2 changes: 1 addition & 1 deletion wapm.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibillingsley/one-slime-army"
version = "1.2.2"
version = "1.2.3"
description = "One Slime Army is an arcade endless wave survival game for the WASM-4 fantasy console"
license = "ISC"
readme = "README.md"
Expand Down

0 comments on commit 04d40f5

Please sign in to comment.