feat: implemented enemies spawning based on current region difficulty
This commit is contained in:
parent
96b5be405c
commit
9b07c70b11
8 changed files with 341 additions and 131 deletions
43
modules/wave_survival/enemy_spawner.h
Normal file
43
modules/wave_survival/enemy_spawner.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef ENEMY_SPAWNER_H
|
||||
#define ENEMY_SPAWNER_H
|
||||
|
||||
#include "core/io/resource.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "scene/3d/node_3d.h"
|
||||
class MapRegion;
|
||||
class PatrolPath;
|
||||
|
||||
class SpawnData : public Resource {
|
||||
GDCLASS(SpawnData, Resource);
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
void set_difficulty_spawns(Dictionary dict);
|
||||
Dictionary get_difficulty_spawns() const;
|
||||
|
||||
public:
|
||||
HashMap<int, Ref<PackedScene>> difficulty_spawns{};
|
||||
};
|
||||
|
||||
class EnemySpawner : public Node3D {
|
||||
GDCLASS(EnemySpawner, Node3D);
|
||||
static void _bind_methods();
|
||||
void on_phase_change(bool hunt);
|
||||
void ready();
|
||||
|
||||
protected:
|
||||
void _notification(int what);
|
||||
|
||||
public:
|
||||
void set_spawn_data(Ref<SpawnData> data);
|
||||
Ref<SpawnData> get_spawn_data() const;
|
||||
void set_patrol_path(PatrolPath *path);
|
||||
PatrolPath *get_patrol_path() const;
|
||||
|
||||
private:
|
||||
Ref<SpawnData> spawn_data{};
|
||||
PatrolPath *patrol_path{ nullptr };
|
||||
MapRegion *region{ nullptr };
|
||||
};
|
||||
|
||||
#endif // !ENEMY_SPAWNER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue