From 5b07c32cd68e2227a0db9f26d5b472643d2e56f2 Mon Sep 17 00:00:00 2001 From: Foohoo Date: Mon, 20 Oct 2025 13:16:49 +0100 Subject: [PATCH] add player scene --- project.godot | 5 +++++ scenes/game.tscn | 12 ++++++++++ scenes/player.tscn | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 scenes/game.tscn create mode 100644 scenes/player.tscn diff --git a/project.godot b/project.godot index 33ce21b..889dd93 100644 --- a/project.godot +++ b/project.godot @@ -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 diff --git a/scenes/game.tscn b/scenes/game.tscn new file mode 100644 index 0000000..3072aa6 --- /dev/null +++ b/scenes/game.tscn @@ -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) diff --git a/scenes/player.tscn b/scenes/player.tscn new file mode 100644 index 0000000..7d6a7d4 --- /dev/null +++ b/scenes/player.tscn @@ -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")