diff --git a/MainMenu.tscn b/MainMenu.tscn new file mode 100644 index 0000000..73e99c9 --- /dev/null +++ b/MainMenu.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=3 format=3 uid="uid://e0g6tbtsqv6j"] + +[ext_resource type="Script" path="res://scripts/menu.gd" id="1_gas10"] +[ext_resource type="Texture2D" uid="uid://077ffi13hk2e" path="res://assets/export/claustrophemia-Layer 1.png" id="2_cmrlt"] + +[node name="Main Menu" type="ColorRect"] +offset_right = 640.0 +offset_bottom = 360.0 +color = Color(0.300955, 0, 0.00368265, 1) +script = ExtResource("1_gas10") + +[node name="Logo" type="TextureRect" parent="."] +texture_filter = 1 +layout_mode = 0 +offset_left = 128.0 +offset_top = 16.0 +offset_right = 512.0 +offset_bottom = 144.0 +texture = ExtResource("2_cmrlt") +stretch_mode = 4 +metadata/_aseprite_wizard_interface_config_ = { +"layer_section": true, +"output_section": true, +"slice_section": false +} +metadata/_aseprite_wizard_config_ = { +"i_mode": 1, +"keep_anim_length": false, +"layer": "Layer 1", +"o_ex_p": "", +"o_folder": "res://assets/export", +"o_name": "claustrophemia-", +"only_visible": true, +"player": "", +"slice": "", +"source": "res://assets/claustrophemia.aseprite" +} +metadata/_aseprite_wizard_source_file_hash_ = "784e92f64bd88aac2d53a52103f858ed" + +[node name="StartButton" type="Button" parent="."] +layout_mode = 0 +offset_left = 256.0 +offset_top = 144.0 +offset_right = 384.0 +offset_bottom = 192.0 +text = "Start" + +[node name="ExitButton" type="Button" parent="."] +layout_mode = 0 +offset_left = 256.0 +offset_top = 216.0 +offset_right = 384.0 +offset_bottom = 264.0 +text = "Exit" diff --git a/assets/bars.jpg b/assets/bars.jpg deleted file mode 100644 index 8c70185..0000000 Binary files a/assets/bars.jpg and /dev/null differ diff --git a/assets/bars.png b/assets/bars.png new file mode 100644 index 0000000..b4cab63 Binary files /dev/null and b/assets/bars.png differ diff --git a/assets/bars.jpg.import b/assets/bars.png.import similarity index 70% rename from assets/bars.jpg.import rename to assets/bars.png.import index 9d73fa7..94a574b 100644 --- a/assets/bars.jpg.import +++ b/assets/bars.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://8trlh7j2pkam" -path="res://.godot/imported/bars.jpg-cab2dec6a2095b0b47f5525c278f01e5.ctex" +uid="uid://cavipaqyic82h" +path="res://.godot/imported/bars.png-97588dd9444fb86009feab97b6cb4d08.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/bars.jpg" -dest_files=["res://.godot/imported/bars.jpg-cab2dec6a2095b0b47f5525c278f01e5.ctex"] +source_file="res://assets/bars.png" +dest_files=["res://.godot/imported/bars.png-97588dd9444fb86009feab97b6cb4d08.ctex"] [params] diff --git a/assets/claustrophemia.aseprite b/assets/claustrophemia.aseprite new file mode 100644 index 0000000..debe7ac Binary files /dev/null and b/assets/claustrophemia.aseprite differ diff --git a/assets/claustrophemia.aseprite.import b/assets/claustrophemia.aseprite.import new file mode 100644 index 0000000..2939c5b --- /dev/null +++ b/assets/claustrophemia.aseprite.import @@ -0,0 +1,14 @@ +[remap] + +importer="aseprite_wizard.plugin.noop" +type="PackedDataContainer" +uid="uid://6ogqpgqsd83w" +path="res://.godot/imported/claustrophemia.aseprite-f800c1af6f87740b4ecb05a00a7741c7.res" + +[deps] + +source_file="res://assets/claustrophemia.aseprite" +dest_files=["res://.godot/imported/claustrophemia.aseprite-f800c1af6f87740b4ecb05a00a7741c7.res"] + +[params] + diff --git a/assets/export/claustrophemia-.png b/assets/export/claustrophemia-.png new file mode 100644 index 0000000..9ec417f Binary files /dev/null and b/assets/export/claustrophemia-.png differ diff --git a/assets/export/claustrophemia-.png.import b/assets/export/claustrophemia-.png.import new file mode 100644 index 0000000..bc20bb4 --- /dev/null +++ b/assets/export/claustrophemia-.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bxf5icvrw7alr" +path="res://.godot/imported/claustrophemia-.png-faa5007b0a73aedbed11008a68ca763a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/export/claustrophemia-.png" +dest_files=["res://.godot/imported/claustrophemia-.png-faa5007b0a73aedbed11008a68ca763a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/export/claustrophemia-Layer 1.png b/assets/export/claustrophemia-Layer 1.png new file mode 100644 index 0000000..e736685 Binary files /dev/null and b/assets/export/claustrophemia-Layer 1.png differ diff --git a/assets/export/claustrophemia-Layer 1.png.import b/assets/export/claustrophemia-Layer 1.png.import new file mode 100644 index 0000000..e62cd7f --- /dev/null +++ b/assets/export/claustrophemia-Layer 1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://077ffi13hk2e" +path="res://.godot/imported/claustrophemia-Layer 1.png-340cf2338b1f4cd63ac6677ea123b1b3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/export/claustrophemia-Layer 1.png" +dest_files=["res://.godot/imported/claustrophemia-Layer 1.png-340cf2338b1f4cd63ac6677ea123b1b3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/export/claustrophemia-Layer 2.png b/assets/export/claustrophemia-Layer 2.png new file mode 100644 index 0000000..241e082 Binary files /dev/null and b/assets/export/claustrophemia-Layer 2.png differ diff --git a/assets/export/claustrophemia-Layer 2.png.import b/assets/export/claustrophemia-Layer 2.png.import new file mode 100644 index 0000000..b20c48b --- /dev/null +++ b/assets/export/claustrophemia-Layer 2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chmuy3pixpc0" +path="res://.godot/imported/claustrophemia-Layer 2.png-bb1d196f7f0b657546f2472a58e5ab33.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/export/claustrophemia-Layer 2.png" +dest_files=["res://.godot/imported/claustrophemia-Layer 2.png-bb1d196f7f0b657546f2472a58e5ab33.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/components/Bars.tscn b/components/Bars.tscn index fe953da..72a163c 100644 --- a/components/Bars.tscn +++ b/components/Bars.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://clptnshbcs6cn"] -[ext_resource type="Texture2D" uid="uid://8trlh7j2pkam" path="res://assets/bars.jpg" id="1_ryukb"] +[ext_resource type="Texture2D" uid="uid://cavipaqyic82h" path="res://assets/bars.png" id="1_xyrd0"] [node name="Bars" type="Control"] layout_mode = 3 @@ -10,6 +10,6 @@ offset_bottom = 40.0 [node name="TextureRect" type="TextureRect" parent="."] layout_mode = 0 -offset_right = 640.0 -offset_bottom = 360.0 -texture = ExtResource("1_ryukb") +offset_right = 40.0 +offset_bottom = 40.0 +texture = ExtResource("1_xyrd0") diff --git a/components/Cra102E.tmp b/components/Cra102E.tmp new file mode 100644 index 0000000..39a9e1f --- /dev/null +++ b/components/Cra102E.tmp @@ -0,0 +1,291 @@ +[gd_scene load_steps=35 format=3 uid="uid://n65kl0jalqdt"] + +[ext_resource type="Texture2D" uid="uid://b447sysxt4rhp" path="res://assets/export/crawler-.png" id="1_bdup0"] +[ext_resource type="Script" path="res://scripts/crawler.gd" id="1_dcux3"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_k4vrw"] +size = Vector2(57, 63) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6iqis"] +atlas = ExtResource("1_bdup0") +region = Rect2(0, 0, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hk6n7"] +atlas = ExtResource("1_bdup0") +region = Rect2(128, 128, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i7pjq"] +atlas = ExtResource("1_bdup0") +region = Rect2(256, 128, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0bqgy"] +atlas = ExtResource("1_bdup0") +region = Rect2(384, 128, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b7rtd"] +atlas = ExtResource("1_bdup0") +region = Rect2(512, 128, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ma61w"] +atlas = ExtResource("1_bdup0") +region = Rect2(640, 128, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gxbrf"] +atlas = ExtResource("1_bdup0") +region = Rect2(0, 192, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jnxq4"] +atlas = ExtResource("1_bdup0") +region = Rect2(128, 192, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_61s2s"] +atlas = ExtResource("1_bdup0") +region = Rect2(256, 192, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4h7cf"] +atlas = ExtResource("1_bdup0") +region = Rect2(384, 192, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4x8lu"] +atlas = ExtResource("1_bdup0") +region = Rect2(512, 192, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3grt7"] +atlas = ExtResource("1_bdup0") +region = Rect2(640, 192, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kw6t0"] +atlas = ExtResource("1_bdup0") +region = Rect2(0, 256, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jc8y7"] +atlas = ExtResource("1_bdup0") +region = Rect2(128, 256, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bhh5b"] +atlas = ExtResource("1_bdup0") +region = Rect2(256, 256, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2w283"] +atlas = ExtResource("1_bdup0") +region = Rect2(384, 256, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xmmn0"] +atlas = ExtResource("1_bdup0") +region = Rect2(512, 256, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5emai"] +atlas = ExtResource("1_bdup0") +region = Rect2(512, 64, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6rkkd"] +atlas = ExtResource("1_bdup0") +region = Rect2(640, 64, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vb5jc"] +atlas = ExtResource("1_bdup0") +region = Rect2(0, 128, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3efcj"] +atlas = ExtResource("1_bdup0") +region = Rect2(128, 0, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bygap"] +atlas = ExtResource("1_bdup0") +region = Rect2(256, 0, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i5vmv"] +atlas = ExtResource("1_bdup0") +region = Rect2(384, 0, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f1jsj"] +atlas = ExtResource("1_bdup0") +region = Rect2(512, 0, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l74ua"] +atlas = ExtResource("1_bdup0") +region = Rect2(640, 0, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_iy6u6"] +atlas = ExtResource("1_bdup0") +region = Rect2(0, 64, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4xmi3"] +atlas = ExtResource("1_bdup0") +region = Rect2(128, 64, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4c0s3"] +atlas = ExtResource("1_bdup0") +region = Rect2(256, 64, 128, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3jc57"] +atlas = ExtResource("1_bdup0") +region = Rect2(384, 64, 128, 64) + +[sub_resource type="SpriteFrames" id="SpriteFrames_e3bx4"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6iqis") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hk6n7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i7pjq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0bqgy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b7rtd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ma61w") +}], +"loop": true, +"name": &"Whip", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6iqis") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gxbrf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jnxq4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_61s2s") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4h7cf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4x8lu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3grt7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kw6t0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jc8y7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bhh5b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2w283") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xmmn0") +}], +"loop": true, +"name": &"death", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6iqis") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5emai") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6rkkd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5emai") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vb5jc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5emai") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6iqis") +}], +"loop": true, +"name": &"jump away", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6iqis") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3efcj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bygap") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i5vmv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f1jsj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_l74ua") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_iy6u6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4xmi3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4c0s3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3jc57") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3jc57") +}], +"loop": true, +"name": &"walk", +"speed": 10.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_s2a15"] +size = Vector2(48, 28) + +[node name="Crawler" type="CharacterBody2D"] +script = ExtResource("1_dcux3") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-3.5, -0.5) +shape = SubResource("RectangleShape2D_k4vrw") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +position = Vector2(-34, 0) +sprite_frames = SubResource("SpriteFrames_e3bx4") +animation = &"Whip" +frame_progress = 0.551191 +metadata/_aseprite_wizard_config_ = { +"layer": "", +"o_ex_p": "", +"o_folder": "res://assets/export", +"o_name": "crawler-", +"only_visible": true, +"slice": "", +"source": "res://assets/crawler_walk.aseprite" +} +metadata/_aseprite_wizard_interface_config_ = { +"output_section": true +} +metadata/_aseprite_wizard_source_file_hash_ = "5428848d159be8aa5f91cd42b4e9cfca" + +[node name="WhipArea" type="Area2D" parent="."] + +[node name="Area2D" type="CollisionShape2D" parent="WhipArea"] +position = Vector2(-42, 2) +shape = SubResource("RectangleShape2D_s2a15") +debug_color = Color(0.949698, 0.110143, 0.492661, 0.42) diff --git a/components/Crawler.tscn b/components/Crawler.tscn index 64ae613..73687f9 100644 --- a/components/Crawler.tscn +++ b/components/Crawler.tscn @@ -3,9 +3,6 @@ [ext_resource type="Texture2D" uid="uid://b447sysxt4rhp" path="res://assets/export/crawler-.png" id="1_bdup0"] [ext_resource type="Script" path="res://scripts/crawler.gd" id="1_dcux3"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_k4vrw"] -size = Vector2(57, 63) - [sub_resource type="AtlasTexture" id="AtlasTexture_6iqis"] atlas = ExtResource("1_bdup0") region = Rect2(0, 0, 128, 64) @@ -253,22 +250,22 @@ animations = [{ "speed": 10.0 }] +[sub_resource type="RectangleShape2D" id="RectangleShape2D_k4vrw"] +size = Vector2(60.5, 63) + [sub_resource type="RectangleShape2D" id="RectangleShape2D_s2a15"] size = Vector2(48, 28) [node name="Crawler" type="CharacterBody2D"] script = ExtResource("1_dcux3") -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(-3.5, -0.5) -shape = SubResource("RectangleShape2D_k4vrw") - [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] texture_filter = 1 position = Vector2(-34, 0) sprite_frames = SubResource("SpriteFrames_e3bx4") animation = &"Whip" -frame_progress = 0.990945 +frame = 4 +frame_progress = 0.768581 metadata/_aseprite_wizard_config_ = { "layer": "", "o_ex_p": "", @@ -283,9 +280,13 @@ metadata/_aseprite_wizard_interface_config_ = { } metadata/_aseprite_wizard_source_file_hash_ = "5428848d159be8aa5f91cd42b4e9cfca" +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-2, 0) +shape = SubResource("RectangleShape2D_k4vrw") + [node name="WhipArea" type="Area2D" parent="."] [node name="Area2D" type="CollisionShape2D" parent="WhipArea"] -position = Vector2(-42, 2) +position = Vector2(-42, 1) shape = SubResource("RectangleShape2D_s2a15") debug_color = Color(0.949698, 0.110143, 0.492661, 0.42) diff --git a/levels/level1/stage1.tscn b/levels/level1/stage1.tscn index b916769..9477318 100644 --- a/levels/level1/stage1.tscn +++ b/levels/level1/stage1.tscn @@ -6,14 +6,14 @@ [ext_resource type="PackedScene" uid="uid://cjiuycwqqxaxn" path="res://components/Player.tscn" id="2_sxo5w"] [ext_resource type="PackedScene" uid="uid://bab4ac3s2n0o1" path="res://components/Borders.tscn" id="3_04xvl"] [ext_resource type="PackedScene" uid="uid://bxbpvgteyfh02" path="res://components/Viruling.tscn" id="5_w7lww"] -[ext_resource type="PackedScene" path="res://components/Bars.tscn" id="6_u2jd3"] +[ext_resource type="PackedScene" uid="uid://clptnshbcs6cn" path="res://components/Bars.tscn" id="6_u2jd3"] [ext_resource type="Texture2D" uid="uid://dailayr5c75eu" path="res://assets/export/top-bottom-.png" id="7_gw1ay"] -[ext_resource type="Script" path="res://scripts/level_1_spawner.gd" id="8_rl47p"] +[ext_resource type="Script" path="res://scripts/stage_1_spawner.gd" id="8_rl47p"] [ext_resource type="Script" path="res://scripts/killbox.gd" id="10_oh0qe"] [ext_resource type="Texture2D" uid="uid://fnp2h8e01hi0" path="res://assets/export/go-.png" id="11_2n86p"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_h5wua"] -size = Vector2(492, 101) +size = Vector2(485.25, 101) [sub_resource type="RectangleShape2D" id="RectangleShape2D_wlwhn"] size = Vector2(46, 359) @@ -28,6 +28,7 @@ position = Vector2(-344, -240) stream = ExtResource("2_qcnna") [node name="Bars" parent="." instance=ExtResource("6_u2jd3")] +z_index = 1 offset_left = -344.0 offset_top = -240.0 offset_right = -304.0 @@ -47,7 +48,34 @@ position = Vector2(-272, -240) [node name="Floor" type="StaticBody2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="Floor"] -z_index = 1 +texture_filter = 1 +position = Vector2(-22.75, 70) +scale = Vector2(0.984663, 0.284722) +texture = ExtResource("7_gw1ay") +metadata/_aseprite_wizard_config_ = { +"i_mode": 1, +"keep_anim_length": false, +"layer": "", +"o_ex_p": "", +"o_folder": "res://assets/export", +"o_name": "top-bottom-", +"only_visible": true, +"player": "", +"slice": "", +"source": "res://assets/TopBottom.aseprite" +} +metadata/_aseprite_wizard_interface_config_ = { +"output_section": true +} +metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"] +position = Vector2(-24.25, 70) +shape = SubResource("RectangleShape2D_h5wua") + +[node name="Ceiling" type="StaticBody2D" parent="."] + +[node name="Sprite2D" type="Sprite2D" parent="Ceiling"] texture_filter = 1 position = Vector2(-28, -191) scale = Vector2(1, 0.283333) @@ -70,39 +98,10 @@ metadata/_aseprite_wizard_interface_config_ = { } metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" -[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"] -position = Vector2(-28, 69) -shape = SubResource("RectangleShape2D_h5wua") - -[node name="Ceiling" type="StaticBody2D" parent="."] - [node name="CollisionShape2D" type="CollisionShape2D" parent="Ceiling"] -position = Vector2(-29, -190) +position = Vector2(-26.625, -190) shape = SubResource("RectangleShape2D_h5wua") -[node name="Sprite2D" type="Sprite2D" parent="Ceiling"] -z_index = 1 -texture_filter = 1 -position = Vector2(-28.5, 68.25) -scale = Vector2(0.99591, 0.284722) -texture = ExtResource("7_gw1ay") -metadata/_aseprite_wizard_config_ = { -"i_mode": 1, -"keep_anim_length": false, -"layer": "", -"o_ex_p": "", -"o_folder": "res://assets/export", -"o_name": "top-bottom-", -"only_visible": true, -"player": "", -"slice": "", -"source": "res://assets/TopBottom.aseprite" -} -metadata/_aseprite_wizard_interface_config_ = { -"output_section": true -} -metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" - [node name="Level1Spawner" type="Node2D" parent="."] script = ExtResource("8_rl47p") diff --git a/levels/level1/stage2.tscn b/levels/level1/stage2.tscn index b880923..bd43f2e 100644 --- a/levels/level1/stage2.tscn +++ b/levels/level1/stage2.tscn @@ -1,17 +1,18 @@ -[gd_scene load_steps=11 format=3 uid="uid://cnpspjqlc7b52"] +[gd_scene load_steps=12 format=3 uid="uid://cnpspjqlc7b52"] -[ext_resource type="Script" path="res://scripts/stage_2.gd" id="1_pqela"] +[ext_resource type="Script" path="res://scripts/stage_2_controller.gd" id="1_pqela"] [ext_resource type="AudioStream" uid="uid://ce3soc3run6um" path="res://assets/Level1BGAudio.wav" id="2_v7wia"] -[ext_resource type="PackedScene" path="res://components/Bars.tscn" id="3_n5aqu"] +[ext_resource type="PackedScene" uid="uid://clptnshbcs6cn" path="res://components/Bars.tscn" id="3_n5aqu"] [ext_resource type="Texture2D" uid="uid://bynsxkfd4t4cn" path="res://assets/export/stage1.png" id="4_d2h5p"] [ext_resource type="PackedScene" uid="uid://cjiuycwqqxaxn" path="res://components/Player.tscn" id="5_kc5l1"] [ext_resource type="PackedScene" uid="uid://bab4ac3s2n0o1" path="res://components/Borders.tscn" id="6_47554"] [ext_resource type="Texture2D" uid="uid://dailayr5c75eu" path="res://assets/export/top-bottom-.png" id="7_gl8tg"] [ext_resource type="Texture2D" uid="uid://fnp2h8e01hi0" path="res://assets/export/go-.png" id="8_usr2a"] -[ext_resource type="Script" path="res://scripts/level_2_spawner.gd" id="9_2n06p"] +[ext_resource type="Script" path="res://scripts/stage_2_spawner.gd" id="9_2n06p"] +[ext_resource type="PackedScene" uid="uid://n65kl0jalqdt" path="res://components/Crawler.tscn" id="9_sqnor"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_a73r6"] -size = Vector2(492, 144.5) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_6gxrd"] +size = Vector2(485.25, 129.5) [node name="World" type="Node2D"] position = Vector2(344, 241) @@ -23,6 +24,7 @@ position = Vector2(-344, -240) stream = ExtResource("2_v7wia") [node name="Bars" parent="." instance=ExtResource("3_n5aqu")] +z_index = 1 offset_left = -344.0 offset_top = -240.0 offset_right = -304.0 @@ -35,70 +37,11 @@ scale = Vector2(1.01667, 1) texture = ExtResource("4_d2h5p") [node name="Player" parent="." instance=ExtResource("5_kc5l1")] -position = Vector2(-247, -41) +position = Vector2(-40, -49) [node name="Borders" parent="." instance=ExtResource("6_47554")] position = Vector2(-272, -240) -[node name="Floor" type="StaticBody2D" parent="."] - -[node name="Sprite2D" type="Sprite2D" parent="Floor"] -z_index = 1 -texture_filter = 1 -position = Vector2(-28, -168.5) -scale = Vector2(1, 0.408333) -texture = ExtResource("7_gl8tg") -flip_v = true -metadata/_aseprite_wizard_config_ = { -"i_mode": 1, -"keep_anim_length": false, -"layer": "", -"o_ex_p": "", -"o_folder": "res://assets/export", -"o_name": "top-bottom-", -"only_visible": true, -"player": "", -"slice": "", -"source": "res://assets/TopBottom.aseprite" -} -metadata/_aseprite_wizard_interface_config_ = { -"output_section": true -} -metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"] -position = Vector2(-28, 69) -shape = SubResource("RectangleShape2D_a73r6") - -[node name="Ceiling" type="StaticBody2D" parent="."] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Ceiling"] -position = Vector2(-29, -168.25) -shape = SubResource("RectangleShape2D_a73r6") - -[node name="Sprite2D" type="Sprite2D" parent="Ceiling"] -z_index = 1 -texture_filter = 1 -position = Vector2(-28.5, 57.75) -scale = Vector2(0.99591, 0.343055) -texture = ExtResource("7_gl8tg") -metadata/_aseprite_wizard_config_ = { -"i_mode": 1, -"keep_anim_length": false, -"layer": "", -"o_ex_p": "", -"o_folder": "res://assets/export", -"o_name": "top-bottom-", -"only_visible": true, -"player": "", -"slice": "", -"source": "res://assets/TopBottom.aseprite" -} -metadata/_aseprite_wizard_interface_config_ = { -"output_section": true -} -metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" - [node name="GoArrow" type="Sprite2D" parent="."] texture_filter = 1 position = Vector2(174, -50) @@ -126,3 +69,66 @@ one_shot = true [node name="Level2Spawner" type="Node2D" parent="."] script = ExtResource("9_2n06p") + +[node name="Crawler2" parent="Level2Spawner" instance=ExtResource("9_sqnor")] +position = Vector2(-200, -41) + +[node name="Crawler" parent="Level2Spawner" instance=ExtResource("9_sqnor")] +position = Vector2(168, -41) + +[node name="Floor" type="StaticBody2D" parent="."] + +[node name="Sprite2D" type="Sprite2D" parent="Floor"] +texture_filter = 1 +position = Vector2(-22.75, 56.125) +scale = Vector2(0.984663, 0.361805) +texture = ExtResource("7_gl8tg") +metadata/_aseprite_wizard_config_ = { +"i_mode": 1, +"keep_anim_length": false, +"layer": "", +"o_ex_p": "", +"o_folder": "res://assets/export", +"o_name": "top-bottom-", +"only_visible": true, +"player": "", +"slice": "", +"source": "res://assets/TopBottom.aseprite" +} +metadata/_aseprite_wizard_interface_config_ = { +"output_section": true +} +metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"] +position = Vector2(-24.25, 55.75) +shape = SubResource("RectangleShape2D_6gxrd") + +[node name="Ceiling" type="StaticBody2D" parent="."] + +[node name="Sprite2D" type="Sprite2D" parent="Ceiling"] +texture_filter = 1 +position = Vector2(-28, -177.5) +scale = Vector2(1, 0.358333) +texture = ExtResource("7_gl8tg") +flip_v = true +metadata/_aseprite_wizard_config_ = { +"i_mode": 1, +"keep_anim_length": false, +"layer": "", +"o_ex_p": "", +"o_folder": "res://assets/export", +"o_name": "top-bottom-", +"only_visible": true, +"player": "", +"slice": "", +"source": "res://assets/TopBottom.aseprite" +} +metadata/_aseprite_wizard_interface_config_ = { +"output_section": true +} +metadata/_aseprite_wizard_source_file_hash_ = "1b764edd2623a4481e3cf82f9aa840f7" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Ceiling"] +position = Vector2(-24, -177) +shape = SubResource("RectangleShape2D_6gxrd") diff --git a/project.godot b/project.godot index 5380190..00caad7 100644 --- a/project.godot +++ b/project.godot @@ -12,8 +12,9 @@ config_version=5 config/name="claustrophemia" config/version="0.0.1" -run/main_scene="res://levels/level1/stage1.tscn" +run/main_scene="res://MainMenu.tscn" config/features=PackedStringArray("4.3", "Forward Plus") +boot_splash/bg_color=Color(0, 0, 0, 1) boot_splash/show_image=false config/icon="res://icon.svg" @@ -62,11 +63,6 @@ jump={ , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) ] } -trigger_completed={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194323,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -] -} toggle_fullscreen={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) diff --git a/scripts/crawler.gd b/scripts/crawler.gd index 091376c..6f79568 100644 --- a/scripts/crawler.gd +++ b/scripts/crawler.gd @@ -1,3 +1,56 @@ class_name Crawler extends Entity +@onready var player = get_parent().get_parent().get_node("Player"); +@onready var sprite = $AnimatedSprite2D +@onready var main_collider = $CollisionShape2D +@onready var whip = $WhipArea + ## Crawl towards the player but stay within striking distance and not super close + +const HEALTH = 40 +const SPEED_MULTIPLIER = 50 +const ATTACK_DAMAGE = 20 + +func _init() -> void: + super._init(HEALTH, SPEED_MULTIPLIER, ATTACK_DAMAGE) + +#func _ready() -> void: + #whip.visible = false + +func face_player(): + var player_position = player.global_position + var crawler_position = global_position + + if player_position.x > crawler_position.x and not sprite.flip_h: + sprite.flip_h = true + main_collider.position.x -= 62 + position.x += 62 + whip.position.x += 10 + elif player_position.x < crawler_position.x and sprite.flip_h: + sprite.flip_h = false + main_collider.position.x += 62 + position.x -= 62 + whip.position.x -= 10 + +func _physics_process(delta: float) -> void: + var distanceToPlayer = global_position.distance_to(player.global_position) + var desiredDistance = 70 + + if sprite.flip_h: + desiredDistance -= 69 + face_player() + print(distanceToPlayer) + + if distanceToPlayer > desiredDistance: + velocity.x = speed + face_player() + + if not sprite.flip_h: + velocity.x *= -1 + + sprite.play("walk") + else: + velocity.x = 0 + sprite.play("Whip") + + move_and_slide() diff --git a/scripts/menu.gd b/scripts/menu.gd new file mode 100644 index 0000000..402ca58 --- /dev/null +++ b/scripts/menu.gd @@ -0,0 +1,14 @@ +extends Control + +@onready var start_button = $StartButton +@onready var exit_button = $ExitButton + +func _ready() -> void: + start_button.button_down.connect(start_game) + exit_button.button_down.connect(exit_game) + +func start_game() -> void: + get_tree().change_scene_to_file("res://levels/level1/stage1.tscn") + +func exit_game() -> void: + get_tree().quit() diff --git a/scripts/level_1_spawner.gd b/scripts/stage_1_spawner.gd similarity index 100% rename from scripts/level_1_spawner.gd rename to scripts/stage_1_spawner.gd diff --git a/scripts/stage_2.gd b/scripts/stage_2_controller.gd similarity index 100% rename from scripts/stage_2.gd rename to scripts/stage_2_controller.gd diff --git a/scripts/level_2_spawner.gd b/scripts/stage_2_spawner.gd similarity index 100% rename from scripts/level_2_spawner.gd rename to scripts/stage_2_spawner.gd