Lesson: Explosion and Jump Effects + Review

This commit is contained in:
Felipe M 2021-01-30 21:09:00 +01:00
parent 842f567ed7
commit 147199a012
Signed by: fmartingr
GPG key ID: 716BC147715E716F
4 changed files with 99 additions and 1 deletions

View file

@ -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()