Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
weapons.hpp File Reference

Weapons: fire rate enforced by the server, for players and for enemies that fire on their own, and the ShotFired event of each shot. More...

#include <aegis2d/core/event_bus.hpp>
#include <aegis2d/core/math.hpp>
#include <aegis2d/ecs/components.hpp>
#include <aegis2d/ecs/entity.hpp>
#include <aegis2d/ecs/registry.hpp>
#include <aegis2d/ecs/system.hpp>
#include <aegis2d/shmup/components.hpp>
#include <span>
#include <vector>

Go to the source code of this file.

Classes

struct  aegis2d::shmup::ShotFired
 An entity fired: one shot leaves it during the tick. More...
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::shmup
 Shoot'em up building blocks on top of the ECS: player ships, their controls, weapons and their shots. A game of another genre leaves the module out.
 

Functions

bool aegis2d::shmup::pull_trigger (Weapon &weapon, float delta, bool pulled) noexcept
 Counts a weapon's reload down by one tick and fires it if the trigger is pulled.
 
void aegis2d::shmup::trigger_weapons (ecs::Registry &registry, const ecs::Tick &tick, std::vector< ecs::Entity > &shooters)
 Finds the ships that fire during this tick and reloads their weapons.
 
void aegis2d::shmup::trigger_auto_weapons (ecs::Registry &registry, const ecs::Tick &tick, std::vector< ecs::Entity > &shooters)
 Finds the entities that fire on their own during this tick and reloads them.
 
void aegis2d::shmup::publish_shots (core::EventBus &events, const ecs::Registry &registry, std::span< const ecs::Entity > shooters)
 Publishes a ShotFired for each entity that fires during the tick.
 

Detailed Description

Weapons: fire rate enforced by the server, for players and for enemies that fire on their own, and the ShotFired event of each shot.