![]() |
R-Type
2
Doom but in better
|
#include "Components.hpp"
Go to the source code of this file.
Macros | |
#define | DEFAULT_TIMER 10.0f |
Functions | |
void | spawn_monster (Registry &r, const float pos_x, const float pos_y) |
Spawns a monster at the specified position. | |
void | spawn_obstacle (Registry &r, const float pos_x, const float pos_y) |
Spawns an obstacle at the specified position. | |
void | spawn_player (Registry &r, const float pos_x, const float pos_y, const uint32_t client_id, const std::string &username) |
Spawns a player with the specified username at the given position. | |
void | spawn_missile (Registry &r, const float pos_x, const float pos_y, const type_enum owner) |
Spawns a missile at the specified position. | |
void | spawn_powerup (Registry &r, const float pos_x, const float pos_y, const loot_enum loot) |
Spawns a power-up at the specified position. | |
void | spawn_monster_system (Registry &r) |
Spawns a monster periodically based on the spawn timer. | |
void | spawn_obstacle_system (Registry &r) |
Spawns obstacles periodically based on the spawn timer. | |
#define DEFAULT_TIMER 10.0f |
Definition at line 7 of file SpawnSystem.hpp.
Spawns a missile at the specified position.
This function spawns a missile entity in the game at the given position (pos_x
, pos_y
) and assigns it to the appropriate owner (player or monster).
r | The Registry that contains all game entities and their components. |
pos_x | The X-coordinate for the missile's initial position. |
pos_y | The Y-coordinate for the missile's initial position. |
owner | The type of the entity that owns the missile (player or monster). |
Definition at line 79 of file SpawnSystem.cpp.
void spawn_monster | ( | Registry & | r, |
const float | pos_x, | ||
const float | pos_y ) |
Spawns a monster at the specified position.
This function spawns a monster entity in the game at the given position (pos_x
, pos_y
). The monster is initialized with appropriate components, such as position and type.
r | The Registry that contains all game entities and their components. |
pos_x | The X-coordinate for the monster's initial position. |
pos_y | The Y-coordinate for the monster's initial position. |
Definition at line 50 of file SpawnSystem.cpp.
void spawn_monster_system | ( | Registry & | r | ) |
Spawns a monster periodically based on the spawn timer.
This system handles the spawning of monsters at regular intervals. The spawn_timer
is used to determine the frequency at which monsters are spawned.
r | The Registry that contains all game entities and their components. |
Definition at line 11 of file SpawnSystem.cpp.
void spawn_obstacle | ( | Registry & | r, |
const float | pos_x, | ||
const float | pos_y ) |
Spawns an obstacle at the specified position.
This function spawns an obstacle entity in the game at the given position (pos_x
, pos_y
). The obstacle is initialized with appropriate components, such as position and type.
r | The Registry that contains all game entities and their components. |
pos_x | The X-coordinate for the obstacle's initial position. |
pos_y | The Y-coordinate for the obstacle's initial position. |
Definition at line 66 of file SpawnSystem.cpp.
void spawn_obstacle_system | ( | Registry & | r | ) |
Spawns obstacles periodically based on the spawn timer.
This system handles the spawning of obstacles at regular intervals. The spawn_obstacle_timer
is used to determine the frequency at which obstacles are spawned.
r | The Registry that contains all game entities and their components. |
Definition at line 23 of file SpawnSystem.cpp.
void spawn_player | ( | Registry & | r, |
const float | pos_x, | ||
const float | pos_y, | ||
const uint32_t | client_id, | ||
const std::string & | username ) |
Spawns a player with the specified username at the given position.
This function spawns a player entity in the game with the specified username. The player is initialized at the given position (pos_x
, pos_y
) and other components related to the player.
r | The Registry that contains all game entities and their components. |
pos_x | The X-coordinate for the player's initial position. |
pos_y | The Y-coordinate for the player's initial position. |
client_it | The client id of the player. |
username | The username of the player. |
Definition at line 34 of file SpawnSystem.cpp.
Spawns a power-up at the specified position.
This function spawns a power-up entity in the game at the given position (pos_x
, pos_y
). The type of power-up is determined by the loot_enum
.
r | The Registry that contains all game entities and their components. |
pos_x | The X-coordinate for the power-up's initial position. |
pos_y | The Y-coordinate for the power-up's initial position. |
loot | The type of loot (power-up or health) to be spawned. |
Definition at line 100 of file SpawnSystem.cpp.