Crystalline-awakening/player.tscn

45 lines
1.3 KiB
Plaintext
Raw Normal View History

2025-05-17 15:50:12 +00:00
[gd_scene load_steps=5 format=3 uid="uid://tpe1cb4ucx0b"]
[ext_resource type="Texture2D" uid="uid://b8l378t64365q" path="res://playerSprite.png" id="1_4flbx"]
[sub_resource type="GDScript" id="GDScript_4flbx"]
resource_name = "movementScript"
script/source = "extends CharacterBody2D
2025-05-17 16:25:57 +00:00
const SPEED = 10.0
2025-05-17 15:50:12 +00:00
func _physics_process(delta: float) -> void:
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction := Input.get_vector(\"moveLeft\", \"moveRight\", \"moveUp\", \"moveDown\")
2025-05-17 16:25:57 +00:00
move_and_collide(direction * SPEED)
2025-05-17 15:50:12 +00:00
"
[sub_resource type="SpriteFrames" id="SpriteFrames_onrkg"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_4flbx")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_i3pqv"]
2025-05-17 16:25:57 +00:00
size = Vector2(22, 22)
2025-05-17 15:07:45 +00:00
[node name="CharacterBody2D" type="CharacterBody2D"]
2025-05-17 16:25:57 +00:00
collision_mask = 2
2025-05-17 15:50:12 +00:00
script = SubResource("GDScript_4flbx")
2025-05-17 15:07:45 +00:00
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
2025-05-17 15:50:12 +00:00
sprite_frames = SubResource("SpriteFrames_onrkg")
2025-05-17 15:07:45 +00:00
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
2025-05-17 15:50:12 +00:00
shape = SubResource("RectangleShape2D_i3pqv")
[node name="Camera2D" type="Camera2D" parent="."]