diff options
Diffstat (limited to 'src/players.c')
| -rw-r--r-- | src/players.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/players.c b/src/players.c index fc3e050..3122af2 100644 --- a/src/players.c +++ b/src/players.c @@ -466,7 +466,7 @@ void draw_player(platform_window* window, player* p, int index) { float player_render_x = player_pos.x; float player_render_y = player_pos.y; - vec2f gun_pos = world_pos_to_screen_pos(window, p->gunx, p->guny, p->gun_height); + vec2f gun_pos = world_pos_to_screen_pos(window, p->gunx - (p->dirx*GUN_OFFSET_FROM_PLAYER), p->guny - (p->diry*GUN_OFFSET_FROM_PLAYER), p->gun_height); float gun_size = info.tile_width * get_gun_size(p->guntype); // Gun @@ -476,7 +476,7 @@ void draw_player(platform_window* window, player* p, int index) { float rads = -atan2(p->diry, p->dirx); renderer->render_set_rotation(rads); - log_infox("%f", rads); + vec2f tl = (vec2f){0.0f, 0.0f}, tr = (vec2f){1.0f, 0.0f}, bl = (vec2f){0.0f, 1.0f}, br = (vec2f){1.0f, 1.0f}; if (rads > M_PI/2 || rads < -M_PI/2) { tl = (vec2f){1.0f, 0.0f}; |
