Crystalline-awakening/player/smallPlayer/playerScript.gd

18 lines
424 B
GDScript3
Raw Normal View History

2025-05-18 12:59:58 +00:00
extends CharacterBody2D
const SPEED = 3.0
2025-05-18 14:16:02 +00:00
var Progress
2025-05-23 12:30:00 +00:00
var direction: Vector2
var animationFinished: bool = false
2025-05-18 14:16:02 +00:00
2025-05-18 12:59:58 +00:00
2025-05-23 12:30:00 +00:00
func _on_intro_animation_animation_finished(anim_name: StringName) -> void:
animationFinished = true
2025-05-18 12:59:58 +00:00
func _physics_process(delta: float) -> void:
2025-05-23 12:30:00 +00:00
#Handles movement
if animationFinished:
direction = Input.get_vector("moveLeft", "moveRight", "moveUp", "moveDown")
move_and_collide(direction * SPEED)