18#define GUN_SHOTGUN_NAME "Beretta 1301 Tactical"
19#define GUN_BATTLE_RIFLE_NAME "FN SCAR-H"
20#define GUN_SMG_NAME "HK UMP45"
21#define GUN_ASSAULT_RIFLE_NAME "M4A1 URG-I"
22#define GUN_PISTOL_NAME "Glock 17"
23#define GUN_REVOLVER_NAME "Chiappa Rhino 200DS"
24#define GUN_ARMOR_PISTOL_NAME "FN Five-seveN Mk3 MRD"
25#define GUN_RAPID_SMG_NAME "KRISS Vector"
26#define GUN_PDW_NAME "FN P90"
27#define GUN_BURST_RIFLE_NAME "M16A4"
28#define GUN_BULLPUP_RIFLE_NAME "Kel-Tec RFB"
29#define GUN_AUTO_SHOTGUN_NAME "Atchisson AA-12"
91#define BULLET_VELOCITY_SLOW 400
92#define BULLET_VELOCITY_MID 600
93#define BULLET_VELOCITY_FAST 800
94#define BULLET_VELOCITY_REAL_FAST 1000
A simple animation system capable of loading a spritesheet with fixed sized frames.
GunFireMode
Definition gun.h:48
@ FIREMODE_SEMI
Semi-automatic (one shot per trigger pull)
Definition gun.h:49
@ FIREMODE_AUTO
Definition gun.h:50
@ FIREMODE_BURST
Fully automatic (continuous fire while trigger held)
Definition gun.h:51
GunData Gun_AssaultRifle
Assault rifle weapon data.
GunData Gun_Shotgun
Shotgun weapon data.
void Gun_Start()
Initializes gun systems.
Definition gun_start.c:23
GunData GunList[GUN_COUNT]
Array of all available guns.
Definition gun_data.c:22
GunData Gun_Pistol
Pistol weapon data.
@ GUN_BURST_RIFLE
Definition gun.h:42
@ GUN_BATTLE_RIFLE
Definition gun.h:37
@ GUN_SHOTGUN
Definition gun.h:35
@ GUN_PISTOL
Definition gun.h:33
@ GUN_COUNT
Definition gun.h:45
@ GUN_REVOLVER
Definition gun.h:38
@ GUN_ASSAULT_RIFLE
Definition gun.h:36
@ GUN_BULLPUP_RIFLE
Definition gun.h:43
@ GUN_SMG
Definition gun.h:34
@ GUN_RAPID_SMG
Definition gun.h:40
@ GUN_AUTO_SHOTGUN
Definition gun.h:44
@ GUN_ARMOR_PISTOL
Definition gun.h:39
@ GUN_PDW
Definition gun.h:41
@ GUN_NONE
Definition gun.h:32
void Gun_UpdatePosition(GunData *gun, Vec2 ownerPosition, Vec2 targetPosition, Vec2 gunOffset)
Updates gun position, orientation and associated particle emitters.
Definition gun_position.c:27
GunData Gun_SMG
SMG weapon data.
void Gun_Update()
Updates gun state.
Definition gun_update.c:27
void Gun_Render()
Renders all guns.
Definition gun_render.c:24
GunData Gun_BattleRifle
Battle rifle weapon data.
void Gun_AnimationUpdate()
Updates gun animations.
Definition gun_animations.c:28
Defines preset particle emitter configurations for common visual effects.
Configuration data for creating an animation.
Definition animation.h:102
The main animation structure.
Definition animation.h:83
Gun configuration structure.
Definition gun.h:80
ParticleEmitter casingPreset
Particle effect for ejected casings.
Definition gun.h:85
Vec2 muzzlePosition
Position where bullets/muzzle flash appears.
Definition gun.h:81
Vec2 ejectionPosition
Position where casings are ejected.
Definition gun.h:82
Vec2 gripPosition
Position where the player holds the gun.
Definition gun.h:83
ParticleEmitter muzzleFlashPreset
Particle effect for muzzle flash.
Definition gun.h:84
Gun data structure.
Definition gun.h:116
Gun type
Type of the gun.
Definition gun.h:117
GunResources resources
Pointers to runtime resources.
Definition gun.h:119
char * name
Name of the gun.
Definition gun.h:118
GunState state
Current state information.
Definition gun.h:120
AnimationData animData
Animation configuration.
Definition gun.h:123
GunStats stats
Stats and capabilities.
Definition gun.h:122
GunConfig config
Configuration data.
Definition gun.h:121
Resources used by a gun.
Definition gun.h:57
Animation * animation
Gun animation.
Definition gun.h:62
ParticleEmitter * bulletFragmentEmitter
Emitter for bullet fragment particles.
Definition gun.h:61
ParticleEmitter * bulletPreset
Preset for bullet particles.
Definition gun.h:60
ParticleEmitter * muzzleFlashEmitter
Emitter for muzzle flash effects.
Definition gun.h:59
ParticleEmitter * casingParticleEmitter
Emitter for ejected shell casings.
Definition gun.h:58
Gun state structure.
Definition gun.h:69
Vec2 position
Current position of the gun.
Definition gun.h:70
float angle
Current rotation angle of the gun.
Definition gun.h:71
SDL_RendererFlip flip
Flip state for rendering.
Definition gun.h:72
SDL_Point rotationCenter
Point around which the gun rotates.
Definition gun.h:73
Gun statistics structure.
Definition gun.h:100
float spread_angle
Bullet spread in degrees.
Definition gun.h:102
int bulletsPerShot
Number of bullets fired per shot (>1 only for shotguns)
Definition gun.h:105
int damage
Damage per bullet.
Definition gun.h:103
GunFireMode fireMode
Firing mode (auto or semi)
Definition gun.h:106
int ammoConsumption
Ammo consumed per shot.
Definition gun.h:108
float fireRate
Shots per minute.
Definition gun.h:101
int bulletVelocity
Velocity of the bullet.
Definition gun.h:107
float bulletLifetime
How long bullets exist before despawning.
Definition gun.h:104
A struct that represents the configurations of a particle emitter.
Definition particles.h:105
A 2D vector structure.
Definition vec2.h:81
Provides 2D vector functionality for positions, directions, and transformations.