summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-11-04 16:58:47 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-11-04 16:58:47 +0100
commit78bb3b9005e8e008cfff6b0158723dd072a957cb (patch)
tree67e602b0996a2878b91bcfb3f64e2ae1045135ea
parentc162e010ae85c636131ff59e8d810be4e9960caa (diff)
inventory
-rw-r--r--build/zombies.exebin1999947 -> 2000459 bytes
-rw-r--r--src/players.c12
2 files changed, 10 insertions, 2 deletions
diff --git a/build/zombies.exe b/build/zombies.exe
index b5f879c..b6202ec 100644
--- a/build/zombies.exe
+++ b/build/zombies.exe
Binary files differ
diff --git a/src/players.c b/src/players.c
index 3e657a0..164b2a8 100644
--- a/src/players.c
+++ b/src/players.c
@@ -253,11 +253,19 @@ void take_player_input(platform_window* window) {
add_message_to_outgoing_queuex(message, *global_state.client);
}
- // throwing
- if (is_right_clicked()) {
+ // grenades
+ if (keyboard_is_key_pressed(KEY_G) && p->throwables.grenades > 0) {
+ p->throwables.grenades--;
network_message message = create_protocol_user_throw(player_id, dirx, diry, THROWABLE_GRENADE);
add_message_to_outgoing_queuex(message, *global_state.client);
}
+
+ // molotovs
+ if (keyboard_is_key_pressed(KEY_F) && p->throwables.molotovs > 0) {
+ p->throwables.molotovs--;
+ network_message message = create_protocol_user_throw(player_id, dirx, diry, THROWABLE_MOLOTOV);
+ add_message_to_outgoing_queuex(message, *global_state.client);
+ }
}
}