6#include "godot_cpp/classes/navigation_agent3d.hpp"
18 virtual void _process(
double delta_time)
override;
44 NavigationAgent3D *
agent{
nullptr};
Subclass Sandbox for car physics. Uses _integrate_forces and local_velocity to abstract the behaviour...
Definition car_physics.hpp:13
Sandboxed subclass of CarPhysics.
Definition car_player.hpp:18
The enemy car, inherits CarPhysics subclass sandbox and uses a NavigationAgent3D to direct it.
Definition enemy_car.hpp:10
float max_speed
Max speed when driving straight ahead.
Definition enemy_car.hpp:36
static void _bind_methods()
Register damage function.
Definition enemy_car.cpp:9
GDCLASS(EnemyCar, CarPhysics)
float turn_target_speed
Desired speed when approaching a corner.
Definition enemy_car.hpp:34
void recalculate_navigation()
Calculate a new path to the player.
Definition enemy_car.cpp:51
NavigationAgent3D * agent
Navigation agent child node.
Definition enemy_car.hpp:44
float brake_distance
Distance from corners at which to start braking.
Definition enemy_car.hpp:38
int recalc_frame_interval
Interval in frames between calls to recalculate_navigation.
Definition enemy_car.hpp:32
float steering_speed
Speed at which to steer.
Definition enemy_car.hpp:40
virtual void _process(double delta_time) override
Update current navigation and acceleration. Recalculate path every recalc_frame_interval frames....
Definition enemy_car.cpp:25
void stop_fleeing()
Called from RallyRushGameMode shield pickup end observer. Stop fleeing from the player.
Definition enemy_car.cpp:47
void damage()
Destroy this object.
Definition enemy_car.cpp:39
virtual void _enter_tree() override
Call parent _enter_tree and fetch object references for later use.
Definition enemy_car.cpp:14
int next_recalc
Frame timer to next recalculate_navigation call.
Definition enemy_car.hpp:30
bool flee
If true, invert goal direction and drive away from the player.
Definition enemy_car.hpp:42
void start_fleeing()
Called from RallyRushGameMode shield pickup observer. Start fleeing from the player.
Definition enemy_car.cpp:43
CarPlayer * player
Reference to the player car.
Definition enemy_car.hpp:46
Definition beacon_powerup.cpp:6