summaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/player.c b/src/player.c
index de51b1c..947b218 100644
--- a/src/player.c
+++ b/src/player.c
@@ -13,15 +13,17 @@ IMPL(draw) {
}
IMPL(update) {
+ static int prev_mouse_l;
LZR_MousePosition(&this->pos[0], &this->pos[1]);
this->player.recoil *= 0.9;
- if (LZR_BUTTON(MOUSE_L) && this->player.recoil < 0.1) {
+ if (LZR_BUTTON(MOUSE_L) && !prev_mouse_l) {
this->player.recoil = 1.0;
LZR_PlaySound(0);
__auto_type e = entity_place_meeting(this, g, -1);
if (e != NULL && e->smash != NULL)
e->smash(e, g);
}
+ prev_mouse_l = LZR_BUTTON(MOUSE_L);
}
IMPL_INIT(player) {