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

Implements update logic for Sabot enemy type. More...

#include <enemy_sabot.h>
#include <player.h>
#include <time_system.h>
#include <random.h>
#include <circle.h>
#include <math.h>

Functions

void Sabot_UpdateGun (EnemyData *data)
 Updates the gun position and orientation for the Sabot enemy.
 
void Sabot_Update (EnemyData *data)
 [PostUpdate] Updates the Sabot enemy's state and behavior
 
void Sabot_UpdateParticles ()
 Updates all particle emitters related to the Sabot enemy.
 

Detailed Description

Implements update logic for Sabot enemy type.

Contains the AI behavior and state updates for the Sabot enemy.

Author
Mango
Date
2025-03-21

Function Documentation

◆ Sabot_Update()

void Sabot_Update ( EnemyData *  data)

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

The Sabot enemy fires tracking projectiles that explode on impact. This function handles movement, targeting, and shooting mechanics.

Parameters
dataPointer to the enemy data structure

◆ Sabot_UpdateGun()

void Sabot_UpdateGun ( EnemyData *  data)

Updates the gun position and orientation for the Sabot 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

◆ Sabot_UpdateParticles()

void Sabot_UpdateParticles ( )

Updates all particle emitters related to the Sabot enemy.

Handles the physics and tracking behavior of Sabot projectiles, including homing behavior, explosion effects, and damage calculation. The Sabot's projectiles are unique in that they track the player for a short time after being fired.