Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
gun_update.c File Reference

Handles gun positioning, animation and state updates. More...

#include <gun.h>
#include <player.h>
#include <input.h>
#include <math.h>
#include <camera.h>

Functions

void Gun_Update ()
 [PostUpdate] Updates the gun's state, position, and particles
 

Detailed Description

Handles gun positioning, animation and state updates.

Updates the position, rotation, and particle systems for weapons based on player position and input direction.

Author
Mango
Date
2025-03-06

Function Documentation

◆ Gun_Update()

void Gun_Update ( )

[PostUpdate] Updates the gun's state, position, and particles

Updates gun state.

Updates the gun's position relative to the player, calculates the angle based on mouse position, and updates particle emitter positions for muzzle flash and casings. Flips the gun sprite horizontally when aiming to the left.