Background character and enemy

This commit is contained in:
2024-10-26 11:32:56 +02:00
parent 706c85338a
commit f55a15e24e
89 changed files with 1616 additions and 0 deletions

18
scenes/chest.tscn Normal file
View File

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://d65w0p8s6dv4"]
[ext_resource type="Texture2D" uid="uid://cxnqvliar8e6v" path="res://sprites/objects/chest_01.png" id="1_pwf4c"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j04xx"]
size = Vector2(14, 12.5)
[node name="Chest" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(0, -6)
texture = ExtResource("1_pwf4c")
region_enabled = true
region_rect = Rect2(0, 0, 15.8215, 16)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -6)
shape = SubResource("RectangleShape2D_j04xx")

55
scenes/enemy.tscn Normal file
View File

@ -0,0 +1,55 @@
[gd_scene load_steps=9 format=3 uid="uid://cw2jmrfd0fivj"]
[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_lkhbv"]
[ext_resource type="Texture2D" uid="uid://dopuijjnd0opy" path="res://sprites/characters/slime.png" id="1_xgtjh"]
[sub_resource type="AtlasTexture" id="AtlasTexture_8hrfx"]
atlas = ExtResource("1_xgtjh")
region = Rect2(0, 0, 32, 37)
[sub_resource type="AtlasTexture" id="AtlasTexture_gm427"]
atlas = ExtResource("1_xgtjh")
region = Rect2(32, 0, 32, 37)
[sub_resource type="AtlasTexture" id="AtlasTexture_m13qv"]
atlas = ExtResource("1_xgtjh")
region = Rect2(64, 0, 32, 37)
[sub_resource type="AtlasTexture" id="AtlasTexture_vtdp4"]
atlas = ExtResource("1_xgtjh")
region = Rect2(96, 0, 32, 37)
[sub_resource type="SpriteFrames" id="SpriteFrames_igl3y"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_8hrfx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gm427")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m13qv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vtdp4")
}],
"loop": true,
"name": &"idle",
"speed": 6.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_x0h3l"]
radius = 5.0
[node name="Enemy" type="CharacterBody2D"]
script = ExtResource("1_lkhbv")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_igl3y")
animation = &"idle"
autoplay = "idle"
frame_progress = 0.290664
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_x0h3l")

70
scenes/game.tscn Normal file
View File

@ -0,0 +1,70 @@
[gd_scene load_steps=5 format=3 uid="uid://d0g87756ww650"]
[ext_resource type="PackedScene" uid="uid://c3i6a6ji8i1q8" path="res://scenes/player.tscn" id="1_fwjx1"]
[ext_resource type="Script" path="res://scripts/game_manager.gd" id="1_gd2n3"]
[ext_resource type="PackedScene" uid="uid://d65w0p8s6dv4" path="res://scenes/chest.tscn" id="2_u0oqr"]
[ext_resource type="PackedScene" uid="uid://cw2jmrfd0fivj" path="res://scenes/enemy.tscn" id="4_7i7ld"]
[node name="Game" type="Node2D"]
[node name="GameManager" type="Node" parent="."]
script = ExtResource("1_gd2n3")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -1
scale = Vector2(1.03, 1.03)
transform = Transform2D(1.03, 0, 0, 1.03, 0, 0)
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
offset_left = -8.0
offset_top = -7.0
offset_right = 1124.0
offset_bottom = 637.0
color = Color(0.726739, 0.942318, 0.74966, 1)
[node name="Enemy" parent="." instance=ExtResource("4_7i7ld")]
position = Vector2(29, 37)
[node name="player" parent="." instance=ExtResource("1_fwjx1")]
position = Vector2(-86, -60)
[node name="Camera2D" type="Camera2D" parent="player"]
position = Vector2(1, -7)
zoom = Vector2(3, 3)
[node name="Node" type="Node" parent="."]
[node name="Chest" parent="Node" instance=ExtResource("2_u0oqr")]
position = Vector2(-109, -43)
[node name="Node2" type="Node" parent="."]
[node name="Chest" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(-136, 14)
[node name="Chest2" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(-125, 76)
[node name="Chest3" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(-40, 31)
[node name="Chest4" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(62, 74)
[node name="Chest5" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(113, 28)
[node name="Chest6" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(156, 87)
[node name="Chest7" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(143, -58)
[node name="Chest8" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(51, -29)
[node name="Chest9" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(-16, -78)
[node name="Chest10" parent="Node2" instance=ExtResource("2_u0oqr")]
position = Vector2(-166, -81)

72
scenes/player.tscn Normal file
View File

@ -0,0 +1,72 @@
[gd_scene load_steps=11 format=3 uid="uid://c3i6a6ji8i1q8"]
[ext_resource type="Texture2D" uid="uid://dl1pu82xwqw3m" path="res://sprites/characters/player.png" id="1_6xeiv"]
[ext_resource type="Script" path="res://scripts/playerscript.gd" id="1_sty7f"]
[sub_resource type="AtlasTexture" id="AtlasTexture_0xuex"]
atlas = ExtResource("1_6xeiv")
region = Rect2(16, 22, 16, 22)
[sub_resource type="AtlasTexture" id="AtlasTexture_xrgwn"]
atlas = ExtResource("1_6xeiv")
region = Rect2(64, 22, 16, 22)
[sub_resource type="AtlasTexture" id="AtlasTexture_2b67c"]
atlas = ExtResource("1_6xeiv")
region = Rect2(112, 22, 16, 22)
[sub_resource type="AtlasTexture" id="AtlasTexture_tq7ih"]
atlas = ExtResource("1_6xeiv")
region = Rect2(160, 22, 16, 22)
[sub_resource type="AtlasTexture" id="AtlasTexture_g88tw"]
atlas = ExtResource("1_6xeiv")
region = Rect2(208, 22, 16, 22)
[sub_resource type="AtlasTexture" id="AtlasTexture_w0a6x"]
atlas = ExtResource("1_6xeiv")
region = Rect2(256, 22, 16, 22)
[sub_resource type="SpriteFrames" id="SpriteFrames_gatfb"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_0xuex")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xrgwn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2b67c")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tq7ih")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_g88tw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w0a6x")
}],
"loop": true,
"name": &"idle",
"speed": 15.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4lp1q"]
radius = 5.0
height = 18.0
[node name="player" type="CharacterBody2D"]
script = ExtResource("1_sty7f")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -8)
sprite_frames = SubResource("SpriteFrames_gatfb")
animation = &"idle"
autoplay = "idle"
frame_progress = 0.0176069
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -9)
shape = SubResource("CapsuleShape2D_4lp1q")