Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
lazer_system.h File Reference
#include <vec2.h>
#include <SDL.h>

Go to the source code of this file.

Classes

struct  Lazer
 

Typedefs

typedef struct Lazer Lazer
 

Functions

void Lazer_Update (Lazer *lazer)
 Updates the lazer's position and handles collisions.
 
void Lazer_Render (Lazer *lazer)
 Renders a lazer with a glowing effect.
 

Typedef Documentation

◆ Lazer

typedef struct Lazer Lazer

Function Documentation

◆ Lazer_Render()

void Lazer_Render ( Lazer *  lazer)

Renders a lazer with a glowing effect.

Parameters
startPositionThe starting position of the lazer
endPositionThe ending position of the lazer
widthThe width of the lazer
lazerPointer to the Lazer struct containing its properties

◆ Lazer_Update()

void Lazer_Update ( Lazer *  lazer)

Updates the lazer's position and handles collisions.

Parameters
startPositionThe starting position of the lazer
directionThe direction of the lazer
damageThe damage the lazer deals to the player (if not zero)
Returns
Vec2 The end position of the lazer after collision or reaching max distance
Parameters
lazerPointer to the Lazer struct containing its properties