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

This file contains the data for the Sentry enemy type. More...

#include <enemy.h>
#include <gun.h>

Go to the source code of this file.

Classes

struct  SentryConfig
 

Enumerations

enum  SentryState { SENTRY_STATE_IDLE , SENTRY_STATE_AIMING , SENTRY_STATE_SHOOTING }
 

Functions

void Sentry_Start (EnemyData *data)
 [Start] Initializes a Sentry enemy instance
 
void Sentry_Update (EnemyData *data)
 [PostUpdate] Updates the Sentry enemy's state and behavior
 
void Sentry_Render (EnemyData *data)
 [Render] Renders the Sentry enemy
 
void Sentry_UpdateParticles ()
 Updates all particle emitters related to the Sentry enemy.
 
void Sentry_RenderParticles ()
 
void Sentry_UpdateGun (EnemyData *data)
 Updates the gun position and orientation for the Sentry enemy.
 
void Sentry_UpdateLazer (EnemyData *data)
 Updates the laser targeting system for the Sentry enemy.
 
void Sentry_RenderLaser (EnemyData *data)
 

Variables

ParticleEmitter * SentryBulletEmitter
 
ParticleEmitter * SentryBulletFragmentsEmitter
 
ParticleEmitter * SentryMuzzleFlashEmitter
 
ParticleEmitter * SentryCasingEmitter
 
SentryConfig SentryConfigData
 
EnemyData SentryData
 [Data] Sentry enemy default data
 

Detailed Description

This file contains the data for the Sentry enemy type.

Enumeration Type Documentation

◆ SentryState

Enumerator
SENTRY_STATE_IDLE 
SENTRY_STATE_AIMING 
SENTRY_STATE_SHOOTING 

Function Documentation

◆ Sentry_Render()

void Sentry_Render ( EnemyData *  data)

[Render] Renders the Sentry enemy

This function handles the rendering of the Sentry enemy type.

Parameters
dataPointer to the enemy data structure

◆ Sentry_RenderLaser()

void Sentry_RenderLaser ( EnemyData *  data)

◆ Sentry_RenderParticles()

void Sentry_RenderParticles ( )

◆ Sentry_Start()

void Sentry_Start ( EnemyData *  data)

[Start] Initializes a Sentry enemy instance

Sets up the Sentry enemy's resources including animations, particle effects, and timers.

Parameters
dataPointer to the enemy data structure to initialize

◆ Sentry_Update()

void Sentry_Update ( EnemyData *  data)

[PostUpdate] Updates the Sentry enemy's state and behavior

Handles the state machine for the Sentry enemy, including idle, aiming, and shooting states. The Sentry enemy uses a laser-based weapon that sweeps across an area after targeting.

Parameters
dataPointer to the enemy data structure

◆ Sentry_UpdateGun()

void Sentry_UpdateGun ( EnemyData *  data)

Updates the gun position and orientation for the Sentry enemy.

Calculates the gun position, rotation, and orientation based on the enemy's position and the player's location. Also updates associated particle emitters for muzzle flash and bullet casings.

Parameters
dataPointer to the enemy data structure

◆ Sentry_UpdateLazer()

void Sentry_UpdateLazer ( EnemyData *  data)

Updates the laser targeting system for the Sentry enemy.

Calculates the laser beam's path from the gun to the first obstacle or player, performing collision detection and damage application when in shooting state. The laser acts as both a visual cue and combat mechanic.

Parameters
dataPointer to the enemy data structure

◆ Sentry_UpdateParticles()

void Sentry_UpdateParticles ( )

Updates all particle emitters related to the Sentry enemy.

Processes particle physics, collision detection, and damage calculation for bullets fired by the Sentry enemy. Also handles visual effects such as muzzle flash, bullet casings, and bullet impact fragments.

Variable Documentation

◆ SentryBulletEmitter

ParticleEmitter* SentryBulletEmitter
extern

◆ SentryBulletFragmentsEmitter

ParticleEmitter* SentryBulletFragmentsEmitter
extern

◆ SentryCasingEmitter

ParticleEmitter* SentryCasingEmitter
extern

◆ SentryConfigData

SentryConfig SentryConfigData
extern

◆ SentryData

EnemyData SentryData
extern

[Data] Sentry enemy default data

This structure defines the default properties, stats and settings for the Sentry enemy type.

◆ SentryMuzzleFlashEmitter

ParticleEmitter* SentryMuzzleFlashEmitter
extern