18 lines
335 B
GDScript
18 lines
335 B
GDScript
extends Node2D
|
|
|
|
export var speed = 100.0
|
|
|
|
var direction = Vector2.DOWN
|
|
|
|
func _physics_process(delta):
|
|
position += direction * speed * delta
|
|
|
|
|
|
func _on_Hitbox_area_entered(area):
|
|
if area.is_in_group("player"):
|
|
area.get_parent().die()
|
|
|
|
|
|
func _on_Hitbox_body_entered(body):
|
|
if body is TileMap or body is StaticBody2D:
|
|
queue_free()
|