1
0
Fork 0
1bit-godot-course/metroidvania/Scenes/Objects/Proyectile.gd

21 lines
356 B
GDScript

extends Node2D
var velocity = Vector2.ZERO
func _process(delta):
position += velocity * delta
func _on_VisibilityNotifier2D_viewport_exited(_viewport):
queue_free()
func _on_Hitbox_body_entered(_body):
# When we collide with the world
queue_free()
func _on_Hitbox_area_entered(_area):
# When we collide with an enemy (a hurtbox)
queue_free()