dash + fire rate
This commit is contained in:
parent
5bac9ddd2a
commit
1318fdd9fc
7 changed files with 105 additions and 16 deletions
|
|
@ -4,12 +4,17 @@ extends Area3D
|
|||
const SPEED := 20.
|
||||
var _initialized := false
|
||||
var velocity: Vector3
|
||||
var health: int = 1:
|
||||
set(v):
|
||||
health = v
|
||||
if v == 0:
|
||||
queue_free()
|
||||
|
||||
func _ready() -> void:
|
||||
body_entered.connect(func(body: Node3D):
|
||||
if body.has_method("hit"):
|
||||
body.hit(self)
|
||||
queue_free()
|
||||
health -= 1
|
||||
)
|
||||
|
||||
func init(dir: Vector3) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue