The Table Engine
projectile_script.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "script.h"
13 
22 class ProjectileScript : public Script {
23 private:
24  float m_dx;
25  float m_dy;
26 
27 public:
34  ProjectileScript(float dx, float dy);
35 
42  void update() override;
43 };
Controls the movement of a projectile.
float m_dx
Horizontal velocity component of the projectile.
float m_dy
Vertical velocity component of the projectile.
ProjectileScript(float dx, float dy)
Constructs a ProjectileScript with specified velocity components.
void update() override
Updates the position of the projectile based on its velocity.
Base class for scripting custom behaviors in game objects.
Definition: script.h:22
Defines the Script class for attaching behavior to game objects.