feat: implemented bullet impacts
This commit is contained in:
parent
7a5c129bb9
commit
a7b3f97b3b
14 changed files with 644 additions and 12 deletions
32
modules/wave_survival/hitscan_muzzle.h
Normal file
32
modules/wave_survival/hitscan_muzzle.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef HITSCAN_MUZZLE_H
|
||||
#define HITSCAN_MUZZLE_H
|
||||
|
||||
#include "scene/3d/physics/ray_cast_3d.h"
|
||||
|
||||
class HitscanMuzzle : public RayCast3D {
|
||||
GDCLASS(HitscanMuzzle, RayCast3D);
|
||||
static void _bind_methods();
|
||||
void ready();
|
||||
|
||||
public:
|
||||
void _notification(int what);
|
||||
void shoot();
|
||||
void shoot_multiple(int count);
|
||||
|
||||
void set_spread(float spread);
|
||||
float get_spread() const;
|
||||
void set_damage(int damage);
|
||||
int get_damage() const;
|
||||
void set_ray_count(int amount);
|
||||
int get_ray_count() const;
|
||||
|
||||
private:
|
||||
float spread{ 0.01f };
|
||||
int damage{ 1 };
|
||||
int ray_count{ 1 };
|
||||
|
||||
Transform3D home_transform{};
|
||||
Ref<PackedScene> impact_effect{};
|
||||
};
|
||||
|
||||
#endif // !HITSCAN_MUZZLE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue