12 lines
284 B
GDScript
12 lines
284 B
GDScript
extends Node2D
|
|
|
|
@export var speed = 100.0
|
|
@export var direction = 1
|
|
var grazed = false
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
position.x += (speed * direction) * delta
|
|
|
|
|
|
func _on_area_2d_body_entered(body: Node2D) -> void:
|
|
if !body.is_in_group("player_hitbox"): queue_free()
|