32 lines
765 B
C++
32 lines
765 B
C++
#ifndef ENEMY_CAR_HPP
|
|
#define ENEMY_CAR_HPP
|
|
|
|
#include "car_physics.hpp"
|
|
#include "car_player.hpp"
|
|
#include "godot_cpp/classes/navigation_agent3d.hpp"
|
|
|
|
namespace godot {
|
|
class EnemyCar : public CarPhysics {
|
|
GDCLASS(EnemyCar, CarPhysics);
|
|
static void _bind_methods();
|
|
public:
|
|
virtual void _enter_tree() override;
|
|
virtual void _process(double delta_time) override;
|
|
void damage();
|
|
protected:
|
|
void process_navigate();
|
|
void recalculate_navigation();
|
|
private:
|
|
int next_recalc{0};
|
|
int recalc_frame_interval{10};
|
|
float turn_target_speed{3.f};
|
|
float max_speed{45.f};
|
|
float brake_distance{7.f};
|
|
float steering_speed{1.f};
|
|
NavigationAgent3D *agent{nullptr};
|
|
CarPlayer *player{nullptr};
|
|
};
|
|
}
|
|
|
|
#endif // !ENEMY_CAR_HPP
|