Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::shmup::Weapon Struct Reference

Gun of a ship: how often it can fire. More...

#include <aegis2d/shmup/components.hpp>

Public Attributes

float cooldown = 0.25F
 Seconds between two shots.
 
float reload = 0.0F
 Seconds before the next shot is allowed; 0 when ready.
 

Detailed Description

Gun of a ship: how often it can fire.

shmup::trigger_weapons() counts the reload down each tick and lets the ship fire when it reaches zero while ecs::Action::Fire is held, so holding fire shoots at 1 / cooldown shots per second whatever the tick rate, and tapping faster than the cooldown does not shoot faster.

Member Data Documentation

◆ cooldown

float aegis2d::shmup::Weapon::cooldown = 0.25F

Seconds between two shots.

◆ reload

float aegis2d::shmup::Weapon::reload = 0.0F

Seconds before the next shot is allowed; 0 when ready.


The documentation for this struct was generated from the following file: