Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
EnemyShootSystem.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_ENEMY_SHOOT_SYSTEM_HPP_
9 #define RTYPE_ENEMY_SHOOT_SYSTEM_HPP_
10
11 #include "RType/ECS/ISystem.hpp"
12 #include "RType/ECS/Registry.hpp"
13
22
23 #include "Systems/RoomSystem.hpp"
24 #include "Systems/NetworkSyncSystem.hpp"
25
26namespace rtp::server {
32 public:
40 RoomSystem& roomSystem,
41 NetworkSyncSystem& networkSync);
42
47 void update(float dt) override;
48
49 private:
58 const ecs::components::RoomId& roomId,
59 bool isBoomerang = false,
60 uint32_t shooterIndex = 0);
61
62 private:
67 float _bulletSpeed = -350.0f;
68 float _spawnOffsetX = -10.0f;
69 };
70}
71
72#endif /* !RTYPE_ENEMY_SHOOT_SYSTEM_HPP_ */
Interface for ECS systems.
Abstract base class for all ECS systems.
Definition ISystem.hpp:57
Spawns bullets for enemies on the server.
float _bulletSpeed
Speed of the spawned bullets.
ecs::Registry & _registry
Reference to the entity registry.
NetworkSyncSystem & _networkSync
Reference to the NetworkSyncSystem.
RoomSystem & _roomSystem
Reference to the RoomSystem.
void spawnBullet(const ecs::components::Transform &tf, const ecs::components::RoomId &roomId, bool isBoomerang=false, uint32_t shooterIndex=0)
Spawn a bullet entity at the given transform and room.
float _spawnOffsetX
X offset for bullet spawn position.
void update(float dt) override
Update enemy shooting system logic for one frame.
System to handle network-related operations on the server side.
System to handle room-related operations on the server side.
File : GameManager.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
Component representing a network identifier for an entity.
Definition RoomId.hpp:22
Component representing position, rotation, and scale of an entity.
Definition Transform.hpp:23