add player scene

This commit is contained in:
2025-10-20 13:16:49 +01:00
parent 9270207826
commit 5b07c32cd6
3 changed files with 72 additions and 0 deletions

View File

@@ -11,5 +11,10 @@ config_version=5
[application]
config/name="brakeys-knight"
run/main_scene="uid://cy3dg66pt8abt"
config/features=PackedStringArray("4.5", "Forward Plus")
config/icon="res://icon.svg"
[rendering]
textures/canvas_textures/default_texture_filter=0

12
scenes/game.tscn Normal file
View File

@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://cy3dg66pt8abt"]
[ext_resource type="PackedScene" uid="uid://3wumh6kpw3ai" path="res://scenes/player.tscn" id="1_uwrxv"]
[node name="Game" type="Node2D"]
[node name="Player" parent="." instance=ExtResource("1_uwrxv")]
position = Vector2(33, 49)
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(39, 27)
zoom = Vector2(4, 4)

55
scenes/player.tscn Normal file
View File

@@ -0,0 +1,55 @@
[gd_scene load_steps=8 format=3 uid="uid://3wumh6kpw3ai"]
[ext_resource type="Texture2D" uid="uid://pc081i405fo4" path="res://assets/sprites/knight.png" id="1_3vyb7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_g2els"]
atlas = ExtResource("1_3vyb7")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qhqgy"]
atlas = ExtResource("1_3vyb7")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_dqkch"]
atlas = ExtResource("1_3vyb7")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qlg0r"]
atlas = ExtResource("1_3vyb7")
region = Rect2(96, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_tuyoq"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_g2els")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qhqgy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dqkch")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qlg0r")
}],
"loop": true,
"name": &"idle",
"speed": 7.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_fjrip"]
radius = 5.0
[node name="Player" type="CharacterBody2D"]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -12)
sprite_frames = SubResource("SpriteFrames_tuyoq")
animation = &"idle"
autoplay = "idle"
frame_progress = 0.33528003
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -5)
shape = SubResource("CircleShape2D_fjrip")