2025-05-18 12:35:48 +00:00
|
|
|
[gd_scene load_steps=15 format=3 uid="uid://c1xy5bf2p6vmh"]
|
2025-05-17 15:50:12 +00:00
|
|
|
|
2025-05-17 16:46:57 +00:00
|
|
|
[ext_resource type="Texture2D" uid="uid://dimdd34ldpix5" path="res://playerSprites/playerSprite_0001.png" id="2_nvl01"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://cmga6fl4uer1m" path="res://playerSprites/playerSprite_0002.png" id="3_ivps1"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://cw0ntcoynkr0w" path="res://playerSprites/playerSprite_0003.png" id="4_urp6f"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://dt3rv4x30n4ru" path="res://playerSprites/playerSprite_0004.png" id="5_bwjto"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://bvnodga8epycb" path="res://playerSprites/playerSprite_0005.png" id="6_606se"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://d5qpoa8wadrp" path="res://playerSprites/playerSprite_0006.png" id="7_u1c27"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://jfhpkm78lqyx" path="res://playerSprites/playerSprite_0007.png" id="8_op7ga"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://jssqmb4832pr" path="res://playerSprites/playerSprite_0008.png" id="9_q13i1"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://dxeg6715vly1v" path="res://playerSprites/playerSprite_0009.png" id="10_pylmc"]
|
2025-05-18 12:35:48 +00:00
|
|
|
[ext_resource type="PackedScene" uid="uid://cnvs3iophpe3n" path="res://Score bar.tscn" id="11_nvl01"]
|
2025-05-17 16:46:57 +00:00
|
|
|
[ext_resource type="Texture2D" uid="uid://b8eut6fnru722" path="res://playerSprites/playerSprite_0010.png" id="11_pbfsw"]
|
2025-05-17 15:50:12 +00:00
|
|
|
|
|
|
|
[sub_resource type="GDScript" id="GDScript_4flbx"]
|
|
|
|
resource_name = "movementScript"
|
|
|
|
script/source = "extends CharacterBody2D
|
|
|
|
|
2025-05-17 16:42:54 +00:00
|
|
|
const SPEED = 3.0
|
2025-05-18 12:35:48 +00:00
|
|
|
func _ready() -> void:
|
|
|
|
var collectable = get_tree().get_root().find_node(\"collectableCrystal\")
|
|
|
|
collectable.connect(\"pickup\",self,\"collect\")
|
2025-05-17 15:50:12 +00:00
|
|
|
|
2025-05-18 12:35:48 +00:00
|
|
|
func collect():
|
|
|
|
print(\"something\")
|
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,
|
2025-05-17 16:42:54 +00:00
|
|
|
"texture": ExtResource("2_nvl01")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("3_ivps1")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("4_urp6f")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("5_bwjto")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("6_606se")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("7_u1c27")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("8_op7ga")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("9_q13i1")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("10_pylmc")
|
|
|
|
}, {
|
|
|
|
"duration": 1.0,
|
|
|
|
"texture": ExtResource("11_pbfsw")
|
2025-05-17 15:50:12 +00:00
|
|
|
}],
|
|
|
|
"loop": true,
|
|
|
|
"name": &"default",
|
2025-05-17 16:42:54 +00:00
|
|
|
"speed": 10.0
|
2025-05-17 15:50:12 +00:00
|
|
|
}]
|
|
|
|
|
|
|
|
[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 16:42:54 +00:00
|
|
|
autoplay = "default"
|
2025-05-17 16:46:57 +00:00
|
|
|
frame_progress = 0.910845
|
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="."]
|
2025-05-17 16:42:54 +00:00
|
|
|
position_smoothing_enabled = true
|
|
|
|
position_smoothing_speed = 10.0
|
2025-05-18 12:35:48 +00:00
|
|
|
|
|
|
|
[node name="Control" parent="." instance=ExtResource("11_nvl01")]
|
|
|
|
offset_left = -263.0
|
|
|
|
offset_top = -164.0
|
|
|
|
offset_right = -263.0
|
|
|
|
offset_bottom = -164.0
|