Lesson: Explosion and Jump Effects + Review
This commit is contained in:
parent
842f567ed7
commit
147199a012
4 changed files with 99 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
extends Node2D
|
||||
|
||||
const ExplosionEffect = preload("res://Scenes/Effects/ExplosionEffect.tscn")
|
||||
|
||||
var velocity = Vector2.ZERO
|
||||
|
||||
func _process(delta):
|
||||
|
@ -12,9 +14,11 @@ func _on_VisibilityNotifier2D_viewport_exited(_viewport):
|
|||
|
||||
func _on_Hitbox_body_entered(_body):
|
||||
# When we collide with the world
|
||||
Utils.instance_scene_on_main(ExplosionEffect, global_position)
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_Hitbox_area_entered(_area):
|
||||
# When we collide with an enemy (a hurtbox)
|
||||
Utils.instance_scene_on_main(ExplosionEffect, global_position)
|
||||
queue_free()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue