PARTICLES
This commit is contained in:
@@ -11,14 +11,13 @@ var gravity_vec = Vector3()
|
||||
|
||||
onready var hurtbox = $Hurtbox/HeadCollision
|
||||
onready var hitbox = $HitBox/CollisionShape
|
||||
onready var animation_player = $AnimationPlayer
|
||||
onready var particles = $CPUParticles
|
||||
onready var death_timer = $DeathTimer
|
||||
onready var mesh = $MeshInstance
|
||||
|
||||
func _ready():
|
||||
animation_player.play("floating")
|
||||
var rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
animation_player.seek(rng.randf_range(0.0,3.0))
|
||||
animation_player.stop()
|
||||
|
||||
func _physics_process(delta):
|
||||
|
||||
@@ -37,7 +36,6 @@ func _physics_process(delta):
|
||||
|
||||
func get_slapped(slap_level, slap_kill, slap_vector):
|
||||
if slap_level >= slap_kill:
|
||||
animation_player.stop()
|
||||
direction = slap_vector * slap_level
|
||||
hurtbox.disabled = true
|
||||
hitbox.disabled = false
|
||||
@@ -47,4 +45,12 @@ func get_shot(hitboxOwner):
|
||||
die()
|
||||
|
||||
func die():
|
||||
particles.emitting = true
|
||||
hurtbox.disabled = true
|
||||
hitbox.disabled = true
|
||||
mesh.visible = false
|
||||
death_timer.start(3)
|
||||
|
||||
|
||||
func _on_DeathTimer_timeout():
|
||||
queue_free()
|
||||
|
||||
Reference in New Issue
Block a user