summaryrefslogtreecommitdiff
path: root/src/players.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-10-27 21:01:21 +0200
committerAldrik Ramaekers <aldrik@amftech.nl>2023-10-27 21:01:21 +0200
commit641f81317a5b5cea6b3c5a4c65b1ca4313b0d8c0 (patch)
tree391bb0b6536ca2247a371f16a44249b8a5f963d6 /src/players.c
parent9d0bb9f229155546fde8b4f666d2682ad5ac606f (diff)
audio, add throwable
Diffstat (limited to 'src/players.c')
-rw-r--r--src/players.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/players.c b/src/players.c
index 2488693..fda8700 100644
--- a/src/players.c
+++ b/src/players.c
@@ -194,6 +194,21 @@ void take_player_input(platform_window* window) {
network_message message = create_protocol_user_shoot(player_id, dirx, diry);
add_message_to_outgoing_queuex(message, *global_state.client);
}
+
+ // throwing
+ if (is_right_clicked()) {
+ float dirx = (_global_mouse.x - (window->width/2));
+ float diry = (_global_mouse.y - (window->height/2));
+ double length = sqrt(dirx * dirx + diry * diry);
+ dirx /= length;
+ diry /= length;
+ log_info("THROWING!");
+ throw_throwable(window, player_id, THROWABLE_GRENADE, dirx, diry);
+ //network_message message = create_protocol_user_shoot(player_id, dirx, diry);
+ //add_message_to_outgoing_queuex(message, *global_state.client);
+ }
+
+
}
void update_players_server() {