HeartBeast/assets/World/Grass.gd
2021-04-04 19:20:44 +02:00

11 lines
332 B
GDScript

extends Sprite
onready var GrassEffect = load("res://assets/Effects/GrassEffect.tscn")
func destroyGrass():
var grassEffect = GrassEffect.instance()
var world = get_tree().current_scene
world.add_child(grassEffect)
grassEffect.global_position = global_position
queue_free()
func _on_Hurtbox_area_entered(area):
destroyGrass()