parent
4e042386f7
commit
7cb7946584
4 changed files with 14 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
const SplashParticles = preload("res://objects/environment/splash/splash_particles.tscn")
|
||||
|
||||
func _physics_process(delta):
|
||||
if not is_on_floor():
|
||||
|
@ -21,3 +22,12 @@ func _on_Hitbox_area_entered(area):
|
|||
var enemy = area.get_owner()
|
||||
if enemy.global_position.y > global_position.y and velocity.y > 0:
|
||||
enemy.die()
|
||||
|
||||
|
||||
func _on_Hitbox_body_entered(body):
|
||||
if body.is_in_group("has_splash"):
|
||||
var particles = SplashParticles.instance()
|
||||
particles.global_position = global_position
|
||||
particles.color = body.splash_color
|
||||
particles.emitting = true
|
||||
get_parent().add_child(particles)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue