feat: implemented enemy wretched patrol and chase states
This commit is contained in:
parent
1b0e4384b9
commit
9517588415
12 changed files with 224 additions and 17 deletions
33
modules/wave_survival/player_detector.h
Normal file
33
modules/wave_survival/player_detector.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef PLAYER_DETECTOR_H
|
||||
#define PLAYER_DETECTOR_H
|
||||
|
||||
#include "player_body.h"
|
||||
#include "scene/3d/node_3d.h"
|
||||
|
||||
class PlayerDetector : public Node3D {
|
||||
GDCLASS(PlayerDetector, Node3D);
|
||||
static void _bind_methods();
|
||||
bool check() const;
|
||||
void ready();
|
||||
void process(double delta);
|
||||
void set_aware_of_player(bool value);
|
||||
|
||||
protected:
|
||||
void _notification(int what);
|
||||
|
||||
public:
|
||||
bool is_aware_of_player() const;
|
||||
|
||||
private:
|
||||
bool aware_of_player{ false };
|
||||
float max_distance{ 100.f };
|
||||
float min_dot{ 0.1f };
|
||||
double query_time{ 0.3 };
|
||||
double query_timer{ 0.0 };
|
||||
PhysicsDirectSpaceState3D::RayParameters ray_params{};
|
||||
|
||||
public:
|
||||
static String sig_awareness_changed;
|
||||
};
|
||||
|
||||
#endif // !PLAYER_DETECTOR_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue