fight system and whatnot

This commit is contained in:
2025-10-29 01:47:45 +01:00
parent 527be3ee5d
commit 84f75cb2a7
41 changed files with 1433 additions and 57 deletions

111
scenes/enemies/skull.tscn Normal file
View File

@@ -0,0 +1,111 @@
[gd_scene load_steps=12 format=3 uid="uid://sr8t2lu6apr4"]
[ext_resource type="Texture2D" uid="uid://c886j66l82ncy" path="res://assets/textures/spritesheets/skull.png" id="1_04wrl"]
[ext_resource type="Script" uid="uid://cuc28u7op02gq" path="res://scripts/enemies/skull.gd" id="1_xx1px"]
[ext_resource type="PackedScene" uid="uid://de71apm4hg6i" path="res://scenes/fightable.tscn" id="3_3gsvf"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_04wrl"]
radius = 9.0
[sub_resource type="CircleShape2D" id="CircleShape2D_04wrl"]
radius = 250.79872
[sub_resource type="CircleShape2D" id="CircleShape2D_xx1px"]
radius = 35.014282
[sub_resource type="AtlasTexture" id="AtlasTexture_3gsvf"]
atlas = ExtResource("1_04wrl")
region = Rect2(0, 0, 32, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_17hur"]
atlas = ExtResource("1_04wrl")
region = Rect2(32, 0, 32, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_lgdni"]
atlas = ExtResource("1_04wrl")
region = Rect2(64, 0, 32, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_7f2rg"]
atlas = ExtResource("1_04wrl")
region = Rect2(96, 0, 32, 64)
[sub_resource type="SpriteFrames" id="SpriteFrames_bidx4"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3gsvf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_17hur")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lgdni")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7f2rg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lgdni")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3gsvf")
}],
"loop": true,
"name": &"default",
"speed": 10.0
}]
[node name="Skull" type="CharacterBody2D"]
y_sort_enabled = true
collision_layer = 0
collision_mask = 2
script = ExtResource("1_xx1px")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(1, 11)
rotation = 1.5707964
shape = SubResource("CapsuleShape2D_04wrl")
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
target_desired_distance = 20.0
avoidance_enabled = true
radius = 16.0
neighbor_distance = 48.0
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" groups=["Enemy"]]
shape = SubResource("CircleShape2D_04wrl")
debug_color = Color(0.4897036, 0.51211786, 0.7549306, 0.41960785)
[node name="FollowUpdateTimer" type="Timer" parent="."]
[node name="AttackTimer" type="Timer" parent="."]
[node name="AttackArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="AttackArea"]
position = Vector2(1, -8)
shape = SubResource("CircleShape2D_xx1px")
debug_color = Color(0.7831714, 0.38409948, 0.54320604, 0.41960785)
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -15)
sprite_frames = SubResource("SpriteFrames_bidx4")
[node name="Fightable" parent="." instance=ExtResource("3_3gsvf")]
[connection signal="velocity_computed" from="NavigationAgent2D" to="." method="_on_navigation_agent_2d_velocity_computed"]
[connection signal="body_entered" from="Area2D" to="." method="_on_area_body_entered"]
[connection signal="body_exited" from="Area2D" to="." method="_on_area_body_exited"]
[connection signal="timeout" from="FollowUpdateTimer" to="." method="_on_follow_update_timer_timeout"]
[connection signal="timeout" from="AttackTimer" to="." method="_on_attack_timer_timeout"]
[connection signal="body_entered" from="AttackArea" to="." method="_on_attack_area_body_entered"]
[connection signal="body_exited" from="AttackArea" to="." method="_on_attack_area_body_exited"]
[connection signal="fought" from="Fightable" to="." method="_on_fightable_fought"]

13
scenes/fightable.tscn Normal file
View File

@@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://de71apm4hg6i"]
[ext_resource type="Script" uid="uid://cvd86i6imfk24" path="res://scripts/fightable.gd" id="1_k4gqj"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ij5l6"]
size = Vector2(32, 32)
[node name="Fightable" type="Area2D"]
collision_layer = 2
script = ExtResource("1_k4gqj")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ij5l6")

View File

@@ -0,0 +1,28 @@
[gd_scene load_steps=5 format=3 uid="uid://56kyfhgeh23"]
[ext_resource type="Texture2D" uid="uid://db4dctk13rgbm" path="res://assets/textures/spritesheets/houses.png" id="1_bgi5t"]
[ext_resource type="PackedScene" uid="uid://h77hilgbces" path="res://scenes/interactables/interact_sceneswitch.tscn" id="2_8jyyi"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fltv6"]
atlas = ExtResource("1_bgi5t")
region = Rect2(1, 2, 158, 151)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0afuu"]
size = Vector2(143.51248, 50.587547)
[node name="Home" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-2, -28)
texture = SubResource("AtlasTexture_fltv6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
y_sort_enabled = true
position = Vector2(-2.2344398, 23.292198)
rotation = -0.0021335608
shape = SubResource("RectangleShape2D_0afuu")
debug_color = Color(0.8768643, 0.34231007, 0.046793222, 0.41960785)
[node name="InteractSceneswitch" parent="." instance=ExtResource("2_8jyyi")]
position = Vector2(49, 32)
scene = "res://scenes/levels/lvl_1.tscn"

View File

@@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=3 uid="uid://bf1tj6ldl520h"]
[ext_resource type="Texture2D" uid="uid://db4dctk13rgbm" path="res://assets/textures/spritesheets/houses.png" id="1_wi6m7"]
[ext_resource type="PackedScene" uid="uid://h77hilgbces" path="res://scenes/interactables/interact_sceneswitch.tscn" id="2_ey5b0"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fltv6"]
atlas = ExtResource("1_wi6m7")
region = Rect2(482, 11, 158, 133)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0afuu"]
size = Vector2(152.00409, 48.003414)
[node name="Home" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-2, -28)
texture = SubResource("AtlasTexture_fltv6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
y_sort_enabled = true
position = Vector2(-2.0000806, 15.002504)
rotation = -0.0021335608
shape = SubResource("RectangleShape2D_0afuu")
debug_color = Color(0.8768643, 0.34231007, 0.046793222, 0.41960785)
[node name="InteractSceneswitch" parent="." instance=ExtResource("2_ey5b0")]
position = Vector2(52, 23)

View File

@@ -0,0 +1,37 @@
[gd_scene load_steps=6 format=3 uid="uid://cj4j8j3fbpkek"]
[ext_resource type="Texture2D" uid="uid://db4dctk13rgbm" path="res://assets/textures/spritesheets/houses.png" id="1_ucxgm"]
[ext_resource type="PackedScene" uid="uid://h77hilgbces" path="res://scenes/interactables/interact_sceneswitch.tscn" id="2_k43hx"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fltv6"]
atlas = ExtResource("1_ucxgm")
region = Rect2(2, 169, 158, 147)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0afuu"]
size = Vector2(146.99966, 50.839867)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ucxgm"]
size = Vector2(78.98275, 7.0426574)
[node name="Home" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-2, -28)
texture = SubResource("AtlasTexture_fltv6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
y_sort_enabled = true
position = Vector2(-2.554564, 13.423307)
rotation = -0.0021335608
shape = SubResource("RectangleShape2D_0afuu")
debug_color = Color(0.8768643, 0.34231007, 0.046793222, 0.41960785)
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
y_sort_enabled = true
position = Vector2(-36.507423, 42.520287)
rotation = -0.0021335608
shape = SubResource("RectangleShape2D_ucxgm")
debug_color = Color(0.8768643, 0.34231007, 0.046793222, 0.41960785)
[node name="InteractSceneswitch" parent="." instance=ExtResource("2_k43hx")]
position = Vector2(-36, 30)

View File

@@ -0,0 +1,37 @@
[gd_scene load_steps=6 format=3 uid="uid://cevq6x1qnwwwo"]
[ext_resource type="Texture2D" uid="uid://db4dctk13rgbm" path="res://assets/textures/spritesheets/houses.png" id="1_cm1ot"]
[ext_resource type="PackedScene" uid="uid://h77hilgbces" path="res://scenes/interactables/interact_sceneswitch.tscn" id="2_1wvia"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fltv6"]
atlas = ExtResource("1_cm1ot")
region = Rect2(322, 16, 157, 128)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0afuu"]
size = Vector2(149.02954, 46.397488)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ucxgm"]
size = Vector2(64.457184, 19.574635)
[node name="Home" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-2, -28)
texture = SubResource("AtlasTexture_fltv6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
y_sort_enabled = true
position = Vector2(1.5026193, -6.772405)
rotation = -0.0021335608
shape = SubResource("RectangleShape2D_0afuu")
debug_color = Color(0.8768643, 0.34231007, 0.046793222, 0.41960785)
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
y_sort_enabled = true
position = Vector2(-40.2494, 26.281471)
rotation = -0.0021335608
shape = SubResource("RectangleShape2D_ucxgm")
debug_color = Color(0.8768643, 0.34231007, 0.046793222, 0.41960785)
[node name="InteractSceneswitch" parent="." instance=ExtResource("2_1wvia")]
position = Vector2(-55, 20)

View File

@@ -9,7 +9,7 @@ load_path = "res://.godot/imported/table_chair.png-e74f8b9bc13823f10c8b29c28e9a3
[sub_resource type="AtlasTexture" id="AtlasTexture_asrj3"]
resource_local_to_scene = true
atlas = SubResource("CompressedTexture2D_o804i")
region = Rect2(-3, 0, 32, 32)
region = Rect2(0, 0, 32, 32)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w04lg"]
size = Vector2(14, 18)

View File

@@ -0,0 +1,129 @@
[gd_scene load_steps=9 format=3 uid="uid://cac5cla8jdogn"]
[ext_resource type="Texture2D" uid="uid://dsapnb753puib" path="res://assets/textures/spritesheets/dark_house_assets.png" id="1_s5xo4"]
[ext_resource type="PackedScene" uid="uid://n24dhbpflcec" path="res://scenes/interactable.tscn" id="2_ljyl3"]
[sub_resource type="GDScript" id="GDScript_enrye"]
script/source = "extends StaticBody2D
@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var anti_softlock_marker: Marker2D = $AntiSoftlockMarker
var open: bool = false
var open1: bool = true
func _on_interactable_interacted(_player: Player) -> void:
if !open:
animation_player.play(\"open\")
open = true
func _on_interactable_body_exited(body: Node2D) -> void:
if open1 && body is Player:
animation_player.speed_scale = 4
animation_player.play_backwards(\"open\")
open1 = false
await animation_player.animation_finished
body.global_position = anti_softlock_marker.global_position
"
[sub_resource type="AtlasTexture" id="AtlasTexture_nmjqc"]
atlas = ExtResource("1_s5xo4")
region = Rect2(160, 64, 32, 64)
[sub_resource type="Animation" id="Animation_ra1dx"]
resource_name = "open"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:texture:region")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Rect2(160, 64, 32, 64), Rect2(144, 64, 32, 64)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape2D2:shape:size")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(48, 5), Vector2(16, 5)]
}
[sub_resource type="Animation" id="Animation_xbx8n"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:texture:region")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Rect2(160, 64, 32, 64)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape2D2:shape:size")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(48, 5)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_clxe4"]
_data = {
&"RESET": SubResource("Animation_xbx8n"),
&"open": SubResource("Animation_ra1dx")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xpwqa"]
size = Vector2(48, 5)
[node name="DarkHouseDoor" type="StaticBody2D"]
script = SubResource("GDScript_enrye")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(32, -16)
texture = SubResource("AtlasTexture_nmjqc")
[node name="Sprite2D2" type="Sprite2D" parent="."]
position = Vector2(0, -16)
texture = SubResource("AtlasTexture_nmjqc")
flip_h = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_clxe4")
}
[node name="Interactable" parent="." instance=ExtResource("2_ljyl3")]
position = Vector2(16, 20)
auto_interact = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-8, 13.5)
shape = SubResource("RectangleShape2D_xpwqa")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
position = Vector2(40, 14)
shape = SubResource("RectangleShape2D_xpwqa")
[node name="AntiSoftlockMarker" type="Marker2D" parent="."]
position = Vector2(16, -26)
[connection signal="body_exited" from="Interactable" to="." method="_on_interactable_body_exited"]
[connection signal="interacted" from="Interactable" to="." method="_on_interactable_interacted"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=4 uid="uid://ccfdsdgaon63m"]
[gd_scene load_steps=11 format=4 uid="uid://ccfdsdgaon63m"]
[ext_resource type="Texture2D" uid="uid://ctr2whxnff2vn" path="res://assets/textures/tilemaps/main_house_interior_tileset.png" id="1_2vl8h"]
[ext_resource type="PackedScene" uid="uid://dfbomt0l6b1o4" path="res://scenes/player.tscn" id="1_ikf4c"]
@@ -17,20 +17,6 @@ func _ready() -> void:
RenderingServer.set_default_clear_color(\"#0d0805\")
"
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_yskkl"]
texture = ExtResource("1_snitx")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
1:0/0 = 0
0:1/0 = 0
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -4, 16, -4, 16, 16, -12, 16)
1:1/0 = 0
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -4, 12, -4, 12, 16, -16, 16)
0:2/0 = 0
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-11.5, -16, 16, -16, 16, -7, -2, -7, -2, 7, -8, 7)
1:2/0 = 0
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 12, -16, 12, -7.5, 9, 7, 2, 7, 2, -7, -16, -7)
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_5uvba"]
texture = ExtResource("1_2vl8h")
texture_region_size = Vector2i(32, 32)
@@ -96,7 +82,6 @@ terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "Ground 0"
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
sources/1 = SubResource("TileSetAtlasSource_5uvba")
sources/0 = SubResource("TileSetAtlasSource_yskkl")
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_d1b6h"]
texture = ExtResource("1_snitx")
@@ -108,9 +93,9 @@ texture_region_size = Vector2i(32, 32)
1:1/0 = 0
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 5.5, 12, 5.5, 12, 16, -16, 16)
0:2/0 = 0
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-11.5, -16, 16, -16, 16, -7, -2, -7, -2, 7, -8, 7)
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -16, 16, -16, 16, 11, -11.5, 11.5)
1:2/0 = 0
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 12, -16, 12, -7.5, 9, 7, 2, 7, 2, -7, -16, -7)
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 12, -16, 12, 11, -16, 11)
[sub_resource type="TileSet" id="TileSet_cchwu"]
tile_size = Vector2i(32, 32)
@@ -157,6 +142,9 @@ y_sort_enabled = true
position = Vector2(176, 235)
tilemap = NodePath("../TileMapLayer")
[node name="AnimatedSprite2D" parent="Player" index="0"]
animation = &"up"
[node name="InteractSceneswitch" parent="." instance=ExtResource("4_snitx")]
position = Vector2(176, 268)
scene = "res://scenes/levels/hood.tscn"

File diff suppressed because one or more lines are too long

155
scenes/levels/lvl_1.tscn Normal file
View File

@@ -0,0 +1,155 @@
[gd_scene load_steps=15 format=4 uid="uid://bdpobbbi6apq5"]
[ext_resource type="Texture2D" uid="uid://2aopgpvv473r" path="res://assets/textures/tilemaps/level_interior_tileset.png" id="1_satx0"]
[ext_resource type="PackedScene" uid="uid://dfbomt0l6b1o4" path="res://scenes/player.tscn" id="2_0t8x2"]
[ext_resource type="PackedScene" uid="uid://sr8t2lu6apr4" path="res://scenes/enemies/skull.tscn" id="3_u5kpk"]
[sub_resource type="NavigationPolygon" id="NavigationPolygon_0t8x2"]
vertices = PackedVector2Array(16, 16, 2, 16, 2, 10, 16, 10)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(2, 10, 16, 10, 16, 16, 2, 16)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_u5kpk"]
vertices = PackedVector2Array(16, 16, 2, 16, 2, -16, 16, -16)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(2, -16, 16, -16, 16, 16, 2, 16)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_ij6uy"]
vertices = PackedVector2Array(16, -8, 2, -8, 2, -16, 16, -16)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(2, -16, 16, -16, 16, -8, 2, -8)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_piajy"]
vertices = PackedVector2Array(16, 16, -16, 16, -16, 10, 16, 10)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-16, 10, 16, 10, 16, 16, -16, 16)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_v45sh"]
vertices = PackedVector2Array(16, 16, -16, 16, -16, -16, 16, -16)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_l6efi"]
vertices = PackedVector2Array(16, -8, -16, -8, -16, -16, 16, -16)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-16, -16, 16, -16, 16, -8, -16, -8)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_3u0n1"]
vertices = PackedVector2Array(-1, 16, -16, 16, -16, 10, -1, 10)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-16, 10, -1, 10, -1, 16, -16, 16)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_2lf8p"]
vertices = PackedVector2Array(-1.5, 16, -16, 16, -16, -16, -1.5, -16)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-16, -16, -1.5, -16, -1.5, 16, -16, 16)])
agent_radius = 0.0
[sub_resource type="NavigationPolygon" id="NavigationPolygon_vpggf"]
vertices = PackedVector2Array(-1, -8, -16, -8, -16, -16, -1, -16)
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
outlines = Array[PackedVector2Array]([PackedVector2Array(-16, -16, -1, -16, -1, -8, -16, -8)])
agent_radius = 0.0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u5kpk"]
texture = ExtResource("1_satx0")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 10, 2, 10, 2, 16, -16, 16)
0:0/0/terrains_peering_bit/bottom_right_corner = 0
0:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_0t8x2")
1:0/0 = 0
1:0/0/terrain_set = 0
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 10, -16, 10)
1:0/0/terrains_peering_bit/bottom_right_corner = 0
1:0/0/terrains_peering_bit/bottom_side = 0
1:0/0/terrains_peering_bit/bottom_left_corner = 0
1:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_piajy")
2:0/0 = 0
2:0/0/terrain_set = 0
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -1, 16, -0.9796982, 10, -16, 10)
2:0/0/terrains_peering_bit/bottom_left_corner = 0
2:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_3u0n1")
0:1/0 = 0
0:1/0/terrain_set = 0
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 2, -16, 2, 16, -16, 16)
0:1/0/terrains_peering_bit/right_side = 0
0:1/0/terrains_peering_bit/bottom_right_corner = 0
0:1/0/terrains_peering_bit/top_right_corner = 0
0:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_u5kpk")
1:1/0 = 0
1:1/0/terrain_set = 0
1:1/0/terrain = 0
1:1/0/terrains_peering_bit/right_side = 0
1:1/0/terrains_peering_bit/bottom_right_corner = 0
1:1/0/terrains_peering_bit/bottom_side = 0
1:1/0/terrains_peering_bit/bottom_left_corner = 0
1:1/0/terrains_peering_bit/left_side = 0
1:1/0/terrains_peering_bit/top_left_corner = 0
1:1/0/terrains_peering_bit/top_side = 0
1:1/0/terrains_peering_bit/top_right_corner = 0
1:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_v45sh")
2:1/0 = 0
2:1/0/terrain_set = 0
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-1, -16, 16, -16, 16, 16, -1, 16)
2:1/0/terrains_peering_bit/bottom_left_corner = 0
2:1/0/terrains_peering_bit/left_side = 0
2:1/0/terrains_peering_bit/top_left_corner = 0
2:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_2lf8p")
0:2/0 = 0
0:2/0/terrain_set = 0
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 2, -16, 2, -8, 16, -8, 16, 16, -16, 16)
0:2/0/terrains_peering_bit/top_right_corner = 0
0:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_ij6uy")
1:2/0 = 0
1:2/0/terrain_set = 0
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, 16, -16, 16, -16, -8, 16, -8)
1:2/0/terrains_peering_bit/top_left_corner = 0
1:2/0/terrains_peering_bit/top_side = 0
1:2/0/terrains_peering_bit/top_right_corner = 0
1:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_l6efi")
2:2/0 = 0
2:2/0/terrain_set = 0
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-1, -16, 16, -16, 16, 16, -16, 16, -16, -8, -1, -8)
2:2/0/terrains_peering_bit/top_left_corner = 0
2:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_vpggf")
[sub_resource type="TileSet" id="TileSet_u5kpk"]
tile_size = Vector2i(32, 32)
physics_layer_0/collision_layer = 1
terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "Ground 0"
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
navigation_layer_0/layers = 1
sources/1 = SubResource("TileSetAtlasSource_u5kpk")
[node name="Lvl1" type="Node2D"]
y_sort_enabled = true
[node name="TileMapLayer" type="TileMapLayer" parent="."]
z_index = -1
y_sort_enabled = true
tile_map_data = PackedByteArray("AAD//wAAAQABAAEAAAAAAAAAAQABAAEAAAAAAAEAAQABAAEAAAD//wEAAQABAAEAAAD+/wEAAQABAAEAAAD+/wAAAQABAAEAAAD+////AQABAAEAAAD/////AQABAAEAAAAAAP//AQABAAEAAAABAAAAAQABAAEAAAABAAEAAQABAAEAAAABAP//AQABAAEAAAAAAP7/AQABAAEAAAABAP7/AQABAAEAAAD///7/AQABAAEAAAD+//7/AQABAAEAAAACAP//AQABAAEAAAACAAAAAQABAAEAAAACAP7/AQABAAEAAAADAP//AQABAAEAAAADAAAAAQABAAEAAAADAP7/AQABAAEAAAAEAP//AQABAAEAAAAEAAAAAQABAAEAAAAEAP7/AQABAAEAAAAEAP3/AQABAAEAAAAFAP3/AQACAAEAAAAFAP7/AQACAAEAAAADAP3/AQABAAEAAAADAPz/AQABAAEAAAAEAPz/AQABAAEAAAAFAPz/AQACAAEAAAAFAP//AQACAAEAAAACAP3/AQABAAEAAAACAPz/AQABAAEAAAABAP3/AQABAAEAAAABAPz/AQABAAEAAAAAAP3/AQABAAEAAAAAAPz/AQABAAEAAAD///3/AQABAAEAAAD///z/AQABAAEAAAD+//3/AQABAAEAAAD+//z/AQABAAEAAAD9////AQABAAEAAAD9//7/AQABAAEAAAD9//3/AQABAAEAAAD9//z/AQABAAEAAAD9/wAAAQABAAEAAAD9/wEAAQABAAEAAAACAAEAAQABAAEAAAACAAIAAQABAAEAAAABAAIAAQABAAEAAAAAAAIAAQABAAEAAAD//wIAAQABAAEAAAD+/wIAAQABAAEAAAD9/wIAAQABAAEAAAADAAEAAQABAAEAAAADAAIAAQABAAEAAAAEAAEAAQABAAEAAAAEAAIAAQABAAEAAAAFAAAAAQACAAEAAAAFAAEAAQACAAEAAAAFAAIAAQACAAEAAAD8/wIAAQABAAEAAAD8/wMAAQABAAIAAAD7/wMAAQABAAIAAAD7/wIAAQABAAEAAAD7/wEAAQABAAEAAAD8/wEAAQABAAEAAAD7/wAAAQABAAEAAAD8/wAAAQABAAEAAAD7////AQABAAEAAAD8////AQABAAEAAAD7//7/AQABAAEAAAD8//7/AQABAAEAAAD7//3/AQABAAEAAAD8//3/AQABAAEAAAD7//z/AQABAAEAAAD8//z/AQABAAEAAAD9/wMAAQABAAIAAAD+/wMAAQABAAIAAAD//wMAAQABAAIAAAAAAAMAAQABAAIAAAABAAMAAQABAAIAAAACAAMAAQABAAIAAAADAAMAAQABAAIAAAAEAAMAAQABAAIAAAAFAAMAAQACAAIAAAD6/wMAAQAAAAIAAAD6/wIAAQAAAAEAAAD6/wEAAQAAAAEAAAD6/wAAAQAAAAEAAAD6////AQAAAAEAAAD6//7/AQAAAAEAAAD6//3/AQAAAAEAAAD6//z/AQAAAAEAAAD6//v/AQAAAAAAAAD7//v/AQABAAAAAAD8//v/AQABAAAAAAD9//v/AQABAAAAAAD+//v/AQABAAAAAAD///v/AQABAAAAAAAAAPv/AQABAAAAAAABAPv/AQABAAAAAAACAPv/AQABAAAAAAADAPv/AQABAAAAAAAEAPv/AQABAAAAAAAFAPv/AQACAAAAAAA=")
tile_set = SubResource("TileSet_u5kpk")
rendering_quadrant_size = 32
physics_quadrant_size = 32
[node name="Player" parent="." node_paths=PackedStringArray("tilemap") instance=ExtResource("2_0t8x2")]
tilemap = NodePath("../TileMapLayer")
[node name="Skull" parent="." instance=ExtResource("3_u5kpk")]
position = Vector2(-111, -50)
[node name="Skull2" parent="." instance=ExtResource("3_u5kpk")]
position = Vector2(8, -106)
[node name="Skull3" parent="." instance=ExtResource("3_u5kpk")]
position = Vector2(140, -102)

16
scenes/menus/hud.tscn Normal file
View File

@@ -0,0 +1,16 @@
[gd_scene load_steps=3 format=3 uid="uid://c48stuhi2qml3"]
[ext_resource type="PackedScene" uid="uid://b7bd4lqwlheti" path="res://scenes/menus/util/hearts.tscn" id="1_xmy64"]
[sub_resource type="GDScript" id="GDScript_xmy64"]
script/source = "class_name HUD
extends CanvasLayer
@onready var hearts: Hearts = $Hearts
"
[node name="HUD" type="CanvasLayer"]
script = SubResource("GDScript_xmy64")
[node name="Hearts" parent="." instance=ExtResource("1_xmy64")]
health = 7

View File

@@ -0,0 +1,95 @@
[gd_scene load_steps=10 format=3 uid="uid://b7bd4lqwlheti"]
[ext_resource type="Texture2D" uid="uid://5pbgeg3yx6cd" path="res://assets/textures/spritesheets/heart.png" id="1_fn71o"]
[ext_resource type="Script" uid="uid://cfplt163iotph" path="res://scripts/menus/util/hearts.gd" id="1_nty8h"]
[sub_resource type="AtlasTexture" id="AtlasTexture_xmy64"]
atlas = ExtResource("1_fn71o")
region = Rect2(33, 1, 14, 13)
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_tfgnj"]
load_path = "res://.godot/imported/heart.png-0efefdd245172a860e354a0c110700fc.ctex"
[sub_resource type="AtlasTexture" id="AtlasTexture_nty8h"]
atlas = SubResource("CompressedTexture2D_tfgnj")
region = Rect2(1, 1, 14, 13)
[sub_resource type="AtlasTexture" id="AtlasTexture_6ej26"]
atlas = SubResource("CompressedTexture2D_tfgnj")
region = Rect2(1, 1, 14, 13)
[sub_resource type="AtlasTexture" id="AtlasTexture_gx0d8"]
atlas = SubResource("CompressedTexture2D_tfgnj")
region = Rect2(1, 1, 14, 13)
[sub_resource type="AtlasTexture" id="AtlasTexture_prrtw"]
atlas = SubResource("CompressedTexture2D_tfgnj")
region = Rect2(1, 1, 14, 13)
[sub_resource type="AtlasTexture" id="AtlasTexture_yvsuk"]
atlas = SubResource("CompressedTexture2D_tfgnj")
region = Rect2(1, 1, 14, 13)
[node name="Hearts" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_left = 8.0
offset_top = 8.0
offset_right = 8.0
offset_bottom = 8.0
script = ExtResource("1_nty8h")
[node name="BackgroundContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_right = 86.0
offset_bottom = 13.0
[node name="TextureRect" type="TextureRect" parent="BackgroundContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_xmy64")
stretch_mode = 2
[node name="TextureRect2" type="TextureRect" parent="BackgroundContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_xmy64")
stretch_mode = 2
[node name="TextureRect3" type="TextureRect" parent="BackgroundContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_xmy64")
stretch_mode = 2
[node name="TextureRect4" type="TextureRect" parent="BackgroundContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_xmy64")
stretch_mode = 2
[node name="TextureRect5" type="TextureRect" parent="BackgroundContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_xmy64")
stretch_mode = 2
[node name="HeartContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_right = 14.0
offset_bottom = 13.0
[node name="TextureRect" type="TextureRect" parent="HeartContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_nty8h")
[node name="TextureRect2" type="TextureRect" parent="HeartContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_6ej26")
[node name="TextureRect3" type="TextureRect" parent="HeartContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_gx0d8")
[node name="TextureRect4" type="TextureRect" parent="HeartContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_prrtw")
[node name="TextureRect5" type="TextureRect" parent="HeartContainer"]
layout_mode = 2
texture = SubResource("AtlasTexture_yvsuk")

View File

@@ -1,7 +1,9 @@
[gd_scene load_steps=22 format=3 uid="uid://dfbomt0l6b1o4"]
[gd_scene load_steps=31 format=3 uid="uid://dfbomt0l6b1o4"]
[ext_resource type="Script" uid="uid://dxvslwwnnlosy" path="res://scripts/player.gd" id="1_3vyb7"]
[ext_resource type="Texture2D" uid="uid://d06cv484ev2n3" path="res://assets/textures/spritesheets/normal_player.png" id="2_qhqgy"]
[ext_resource type="PackedScene" uid="uid://c48stuhi2qml3" path="res://scenes/menus/hud.tscn" id="3_qhqgy"]
[ext_resource type="Texture2D" uid="uid://c1yunf5rn1ncd" path="res://assets/textures/spritesheets/attack.png" id="4_dqkch"]
[sub_resource type="AtlasTexture" id="AtlasTexture_dqkch"]
atlas = ExtResource("2_qhqgy")
@@ -15,30 +17,30 @@ region = Rect2(32, 0, 32, 32)
atlas = ExtResource("2_qhqgy")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fjrip"]
atlas = ExtResource("2_qhqgy")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_3v2ag"]
atlas = ExtResource("2_qhqgy")
region = Rect2(96, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jej6c"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fjrip"]
atlas = ExtResource("2_qhqgy")
region = Rect2(96, 0, 32, 32)
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_f1ej7"]
atlas = ExtResource("2_qhqgy")
region = Rect2(0, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_oprun"]
[sub_resource type="AtlasTexture" id="AtlasTexture_jej6c"]
atlas = ExtResource("2_qhqgy")
region = Rect2(64, 32, 32, 32)
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_a8ls1"]
atlas = ExtResource("2_qhqgy")
region = Rect2(32, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_oprun"]
atlas = ExtResource("2_qhqgy")
region = Rect2(64, 32, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qfm1y"]
atlas = ExtResource("2_qhqgy")
region = Rect2(96, 0, 32, 32)
@@ -92,36 +94,36 @@ animations = [{
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_fjrip")
"texture": SubResource("AtlasTexture_3v2ag")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3v2ag")
"texture": SubResource("AtlasTexture_fjrip")
}],
"loop": true,
"loop": false,
"name": &"hand_down",
"speed": 3.0
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_jej6c")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f1ej7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jej6c")
}],
"loop": true,
"loop": false,
"name": &"hand_side",
"speed": 3.0
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_oprun")
"texture": SubResource("AtlasTexture_a8ls1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a8ls1")
"texture": SubResource("AtlasTexture_oprun")
}],
"loop": true,
"loop": false,
"name": &"hand_up",
"speed": 3.0
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
@@ -178,7 +180,58 @@ animations = [{
radius = 6.0
height = 14.0
[sub_resource type="AtlasTexture" id="AtlasTexture_d2wvv"]
atlas = ExtResource("4_dqkch")
region = Rect2(0, 0, 32, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_i4ail"]
atlas = ExtResource("4_dqkch")
region = Rect2(0, 16, 32, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_a38lo"]
atlas = ExtResource("4_dqkch")
region = Rect2(0, 32, 32, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_4ni07"]
atlas = ExtResource("4_dqkch")
region = Rect2(0, 48, 32, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_l71n6"]
atlas = ExtResource("4_dqkch")
region = Rect2(0, 64, 32, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_y4r1p"]
atlas = ExtResource("4_dqkch")
region = Rect2(0, 80, 32, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_ke2ow"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_d2wvv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_i4ail")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a38lo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4ni07")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l71n6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_y4r1p")
}],
"loop": false,
"name": &"default",
"speed": 12.0
}]
[node name="Player" type="CharacterBody2D"]
collision_layer = 3
motion_mode = 1
script = ExtResource("1_3vyb7")
@@ -198,8 +251,20 @@ drag_horizontal_enabled = true
drag_vertical_enabled = true
[node name="RayCast2D" type="RayCast2D" parent="."]
target_position = Vector2(0, 32)
position = Vector2(0, 10)
target_position = Vector2(0, 22)
collision_mask = 2
hit_from_inside = true
collide_with_areas = true
collide_with_bodies = false
[node name="HUD" parent="." instance=ExtResource("3_qhqgy")]
[node name="CursorHideTimer" type="Timer" parent="."]
[node name="FightAnimation" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_ke2ow")
frame = 5
frame_progress = 1.0
offset = Vector2(0, 24)
flip_v = true