added enemy health bar and target with markers
This commit is contained in:
@@ -8,6 +8,7 @@ var rng = RandomNumberGenerator.new()
|
||||
var random_rotation = true
|
||||
var particle_number
|
||||
var player_velocity
|
||||
var despawning = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
@@ -32,11 +33,15 @@ func _process(delta):
|
||||
if level_control != null: #replace this check when level reload works properly
|
||||
if level_control.particle_number >= (particle_number + level_control.MAX_PARTICLES):
|
||||
_on_timer_timeout()
|
||||
|
||||
if despawning:
|
||||
linear_velocity.y -= .1 * delta
|
||||
|
||||
func _on_timer_timeout():
|
||||
collision_shape.disabled = true
|
||||
gravity_scale = .1
|
||||
await get_tree().create_timer(1).timeout
|
||||
gravity_scale = 0
|
||||
despawning = true
|
||||
await get_tree().create_timer(2).timeout
|
||||
queue_free()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user