The Table Engine
ranged_weapon_script.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "script.h"
12 
21 class RangedWeaponScript : public Script {
22 private:
23  bool m_shoot;
27 
28 public:
35 
42  void input() override;
43 
51  void update() override;
52 };
Controls the behavior of ranged weapons such as bows or guns.
bool m_shoot
Flag to indicate whether the weapon should shoot.
RangedWeaponScript()
Constructs a RangedWeaponScript with default or initial settings.
void input() override
Processes input to handle shooting actions.
int m_lastFireTimeInMs
Timestamp of the last shooting action in milliseconds.
bool m_animationPlayed
Ensures that the shooting animation plays correctly.
void update() override
Updates the state of the weapon based on input and time constraints.
int m_fireRatePerSecond
Allowed number of shots per second to control shooting frequency.
Base class for scripting custom behaviors in game objects.
Definition: script.h:22
Defines the Script class for attaching behavior to game objects.