Want to contribute? Fork me on Codeberg.org!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
307 B

extends CharacterBody2D
@export var speed = 300.0
func _physics_process(delta):
var collision = move_and_collide(velocity * delta)
if collision:
if collision.get_position().x > position.x:
velocity.x = -velocity.x
else:
velocity.y = -velocity.y
collision_mask = 0
$Trail.shrinking = true