Gameplay Components
Source file: client/include/components/GameplayComponents.hpp
Purpose: Describe gameplay-facing components: player state, enemy markers, projectiles, movement patterns, timed/frame-based events, health and UI bars.
PlayerTag
- Core player stats: max speed
speed_max, shoot cooldownshoot_cooldown_max, minimum charge timecharge_time_min. - Runtime state:
isInPlay(spawned in arena),shoot_cooldown,charge_time,playerNumber. - Consumed by input/movement/shoot systems to gate control and calculate speeds.
AnimationEnterPlayer
isEnteringflag used byAnimationEnterPlayerSystemto slide the player into the playfield before enabling controls.
EnemyTag
- Basic enemy metadata (current
speed) so AI or movement systems can scale behaviors.
TimedEvents
- Holds a list of
CooldownAction(callbackaction(entity_id),cooldown_max, currentcooldown). AddCooldownActionregisters periodic tasks;TimedEventSystemincrements timers and fires callbacks when thresholds are met.
FrameEvents
- List of
FrameEvent(target animation name, trigger frame, callback,triggeredlatch). AddFrameEventconfigures per-frame hooks;FrameBaseEventSystemtriggers callbacks when the animation reaches the specified frame and resets on loop.
EnemyShootTag
- Tuning for enemy shots:
speed_projectile,damage_projectile, and localoffset_shoot_positionto position the muzzle.
Projectile
- Damage payload
damage, traveldirection,speed, owner identifierownerId, andisEnemyProjectileto filter friendly fire. - Used by collision and lifetime systems to apply damage and clean up.
Health
- Hit points
currentHealth/maxHealthplus invulnerability controls (invincible,invincibilityDuration,invincibilityTimer). - Health deduction and death handling systems rely on these fields to trigger hit and death animations.
StatsGame
- Score tracking for an entity (
score), typically updated on kills or pickups.
ParrallaxLayer
- Parallax scroll speed
scroll_speedconsumed byParallaxSystemto move background layers and loop them smoothly.
AnimationDeath
- Marker
is_deadindicating a death animation is playing;DeathAnimationSystemremoves the entity when the animation finishes.
PatternMovement
- Encodes movement patterns via
PatternType(Straight, Sine*, ZigZag*, Wave, Waypoints, FollowPlayer, Circular). - Parameters:
elapsed,spawnPos,baseDir,baseSpeed,amplitude,frequency,waypoints,currentWaypoint,waypointThreshold,angle,radius,targetEntityId. PaternMovementSysteminterprets these to set velocities or absolute positions each frame.
HealthBar
- UI data for health display:
offset, instantaneouspercent, delayedpercent_delay, damage timers and flags. - Holds sprites/textures (green, yellow, foreground) with
is_loadedto render the multi-layer health bar.