diff --git a/enemies/boss/Untitled 15.png b/enemies/boss/Untitled 15.png new file mode 100644 index 0000000..eee0d7c Binary files /dev/null and b/enemies/boss/Untitled 15.png differ diff --git a/enemies/boss/Untitled 15.png.import b/enemies/boss/Untitled 15.png.import new file mode 100644 index 0000000..44aa618 --- /dev/null +++ b/enemies/boss/Untitled 15.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://caqimfmdp7jsd" +path="res://.godot/imported/Untitled 15.png-9f7aef1d51ca656d39c301d3244f358e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://enemies/boss/Untitled 15.png" +dest_files=["res://.godot/imported/Untitled 15.png-9f7aef1d51ca656d39c301d3244f358e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/enemies/boss/boss.gd b/enemies/boss/boss.gd index 4bf6c8a..e1486cb 100644 --- a/enemies/boss/boss.gd +++ b/enemies/boss/boss.gd @@ -24,6 +24,12 @@ func choose_next_move() -> String: if $EnemyHurtbox.hp < $EnemyHurtbox.max_hp / 3 and risen == 1: risen += 1 return "water_rise" + + var pool = ["splash"] + if not (position.length() - %Water.radius < 300 and randf()<0.75): + pool.append("slam") + if not (player.position.length() > %Water.radius + 900 and randf()<0.75): + pool.append("wave") return ["slam", "wave", "splash"].pick_random() func _physics_process(delta: float) -> void: diff --git a/enemies/boss/boss.tscn b/enemies/boss/boss.tscn index 0833ca3..e314c51 100644 --- a/enemies/boss/boss.tscn +++ b/enemies/boss/boss.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=10 format=3 uid="uid://cpe4s6vsn0ujd"] -[ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost/ghost animation/Ghost 1.png" id="1_6xxrv"] [ext_resource type="Script" uid="uid://uv672p8f4n6k" path="res://enemies/boss/boss.gd" id="1_skx2t"] [ext_resource type="PackedScene" uid="uid://bg2hgia0jqnqf" path="res://enemies/boss/blob_big.tscn" id="2_o1i15"] [ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_skx2t"] +[ext_resource type="Texture2D" uid="uid://q5mu3lxlsd6f" path="res://enemies/boss/boss2.png" id="3_opohk"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="4_lnbgr"] [ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="6_opohk"] [ext_resource type="AudioStream" uid="uid://c54uipjpvhal7" path="res://sounds/751710__el_boss__tree-hit-skier-tree-impact-variation-2-of-3.wav" id="7_auiwu"] @@ -14,6 +14,7 @@ size = Vector2(300, 250) [node name="Boss" type="CharacterBody2D"] +scale = Vector2(1.8, 1.8) collision_mask = 32 script = ExtResource("1_skx2t") big_blob = ExtResource("2_o1i15") @@ -24,8 +25,8 @@ scale = Vector2(10, 10) shape = SubResource("CapsuleShape2D_lnbgr") [node name="Sprite2D" type="Sprite2D" parent="."] -scale = Vector2(3.85156, 1.9375) -texture = ExtResource("1_6xxrv") +scale = Vector2(1.5, 1.5) +texture = ExtResource("3_opohk") [node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("2_skx2t")] collision_layer = 16 @@ -38,12 +39,6 @@ rotation = 1.5708 scale = Vector2(11, 11) shape = SubResource("CapsuleShape2D_lnbgr") -[node name="CollisionShape2D2" type="CollisionShape2D" parent="EnemyHurtbox"] -position = Vector2(0, 6) -rotation = 1.5708 -scale = Vector2(5, 14) -shape = SubResource("CapsuleShape2D_lnbgr") - [node name="EarthAligner" parent="." instance=ExtResource("4_lnbgr")] [node name="Hitbox" type="Area2D" parent="."] diff --git a/enemies/boss/boss2.png b/enemies/boss/boss2.png new file mode 100644 index 0000000..88347d4 Binary files /dev/null and b/enemies/boss/boss2.png differ diff --git a/enemies/boss/boss2.png.import b/enemies/boss/boss2.png.import new file mode 100644 index 0000000..2b2ec20 --- /dev/null +++ b/enemies/boss/boss2.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://q5mu3lxlsd6f" +path="res://.godot/imported/boss2.png-35ba66553dce9db015aee038fd8ec691.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://enemies/boss/boss2.png" +dest_files=["res://.godot/imported/boss2.png-35ba66553dce9db015aee038fd8ec691.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/enemies/boss/slime-impact-352473.mp3 b/enemies/boss/slime-impact-352473.mp3 new file mode 100644 index 0000000..02868a8 Binary files /dev/null and b/enemies/boss/slime-impact-352473.mp3 differ diff --git a/enemies/boss/slime-impact-352473.mp3.import b/enemies/boss/slime-impact-352473.mp3.import new file mode 100644 index 0000000..d3221ca --- /dev/null +++ b/enemies/boss/slime-impact-352473.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://ngkksuy3438s" +path="res://.godot/imported/slime-impact-352473.mp3-fb4475c7240b9b9964b3f9549708ada2.mp3str" + +[deps] + +source_file="res://enemies/boss/slime-impact-352473.mp3" +dest_files=["res://.godot/imported/slime-impact-352473.mp3-fb4475c7240b9b9964b3f9549708ada2.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/enemies/leech/giant_leech.tscn b/enemies/leech/giant_leech.tscn index 74de772..8e67243 100644 --- a/enemies/leech/giant_leech.tscn +++ b/enemies/leech/giant_leech.tscn @@ -12,7 +12,7 @@ size = Vector2(2, 24) scale = Vector2(1, 1.2) script = ExtResource("1_wfsrb") broadth = 400 -hp = 500 +hp = 300 [node name="Segments" type="Node2D" parent="."] diff --git a/enemies/leech/leech.tscn b/enemies/leech/leech.tscn index dd6f008..76c0c69 100644 --- a/enemies/leech/leech.tscn +++ b/enemies/leech/leech.tscn @@ -12,7 +12,7 @@ size = Vector2(2, 12) scale = Vector2(1, 1.2) script = ExtResource("1_6u582") broadth = 200 -hp = 250 +hp = 80 [node name="Segments" type="Node2D" parent="."] diff --git a/enemies/leech/segment.tscn b/enemies/leech/segment.tscn index 85a8274..36d90e9 100644 --- a/enemies/leech/segment.tscn +++ b/enemies/leech/segment.tscn @@ -21,6 +21,7 @@ scale = Vector2(2, 1) shape = SubResource("RectangleShape2D_fgt1l") [node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("3_sa5vt")] +collision_layer = 16 canvasItem = NodePath("..") flashColor = Color(2.00392, 2.00392, 2.00392, 1) diff --git a/main.tscn b/main.tscn index d2ac440..218b46d 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://bjuak0sbjpamb"] +[gd_scene load_steps=13 format=3 uid="uid://cxo6bq26huau7"] [ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"] [ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"] diff --git a/player/Attack animation 2/Attack animation 2 0.png b/player/Attack animation 2/Attack animation 2 0.png new file mode 100644 index 0000000..6e43f64 Binary files /dev/null and b/player/Attack animation 2/Attack animation 2 0.png differ diff --git a/player/Attack animation 2/Attack animation 2 0.png.import b/player/Attack animation 2/Attack animation 2 0.png.import new file mode 100644 index 0000000..e2b91d6 --- /dev/null +++ b/player/Attack animation 2/Attack animation 2 0.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ds8mbsjrianb3" +path="res://.godot/imported/Attack animation 2 0.png-bee614c7048cfe5af9fb2b5e7ae9f4cf.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/Attack animation 2/Attack animation 2 0.png" +dest_files=["res://.godot/imported/Attack animation 2 0.png-bee614c7048cfe5af9fb2b5e7ae9f4cf.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/player/Attack animation 2/Attack animation 2 1.png b/player/Attack animation 2/Attack animation 2 1.png new file mode 100644 index 0000000..d2e046f Binary files /dev/null and b/player/Attack animation 2/Attack animation 2 1.png differ diff --git a/player/Attack animation 2/Attack animation 2 1.png.import b/player/Attack animation 2/Attack animation 2 1.png.import new file mode 100644 index 0000000..4a27de0 --- /dev/null +++ b/player/Attack animation 2/Attack animation 2 1.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxr4idwjaq4kx" +path="res://.godot/imported/Attack animation 2 1.png-8ef772c290f1c8402be5769b56bb7538.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/Attack animation 2/Attack animation 2 1.png" +dest_files=["res://.godot/imported/Attack animation 2 1.png-8ef772c290f1c8402be5769b56bb7538.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/player/Attack animation 2/Attack animation 2 2.png b/player/Attack animation 2/Attack animation 2 2.png new file mode 100644 index 0000000..61a5be7 Binary files /dev/null and b/player/Attack animation 2/Attack animation 2 2.png differ diff --git a/player/Attack animation 2/Attack animation 2 2.png.import b/player/Attack animation 2/Attack animation 2 2.png.import new file mode 100644 index 0000000..7a1af31 --- /dev/null +++ b/player/Attack animation 2/Attack animation 2 2.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://doywx3flx6pvo" +path="res://.godot/imported/Attack animation 2 2.png-feec64f4578890aefe95de6c606f280c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/Attack animation 2/Attack animation 2 2.png" +dest_files=["res://.godot/imported/Attack animation 2 2.png-feec64f4578890aefe95de6c606f280c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/player/Attack animation 2/Attack animation 2 3.png b/player/Attack animation 2/Attack animation 2 3.png new file mode 100644 index 0000000..c3df9ea Binary files /dev/null and b/player/Attack animation 2/Attack animation 2 3.png differ diff --git a/player/Attack animation 2/Attack animation 2 3.png.import b/player/Attack animation 2/Attack animation 2 3.png.import new file mode 100644 index 0000000..0a29c71 --- /dev/null +++ b/player/Attack animation 2/Attack animation 2 3.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bs8rolxcg4bib" +path="res://.godot/imported/Attack animation 2 3.png-e4dcdf8f3b19eca3490909d397f2acff.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/Attack animation 2/Attack animation 2 3.png" +dest_files=["res://.godot/imported/Attack animation 2 3.png-e4dcdf8f3b19eca3490909d397f2acff.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/player/Attack animation 2/Attack animation 2 4 .png b/player/Attack animation 2/Attack animation 2 4 .png new file mode 100644 index 0000000..bed801e Binary files /dev/null and b/player/Attack animation 2/Attack animation 2 4 .png differ diff --git a/player/Attack animation 2/Attack animation 2 4 .png.import b/player/Attack animation 2/Attack animation 2 4 .png.import new file mode 100644 index 0000000..0a2a0d5 --- /dev/null +++ b/player/Attack animation 2/Attack animation 2 4 .png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6su58pdrqqhd" +path="res://.godot/imported/Attack animation 2 4 .png-45fcef78e48a7653417b05de25a236d4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/Attack animation 2/Attack animation 2 4 .png" +dest_files=["res://.godot/imported/Attack animation 2 4 .png-45fcef78e48a7653417b05de25a236d4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/player/player.gd b/player/player.gd index ceb1f8f..c01a18d 100644 --- a/player/player.gd +++ b/player/player.gd @@ -167,6 +167,10 @@ func die(): player_died.emit() dead = true +func _on_attack_end(): + if($AnimatedSprite2D.animation != "idle"): + $AnimatedSprite2D.play("idle") + $AnimatedSprite2D.stop() func _on_death_screen_visibility_changed() -> void: handle_input = !handle_input diff --git a/player/player.tscn b/player/player.tscn index 1a856a3..fd7dbde 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -3,16 +3,17 @@ [ext_resource type="Script" uid="uid://ddidj1uau28ck" path="res://player/player.gd" id="1_4flbx"] [ext_resource type="Texture2D" uid="uid://c4xg25s8loxp0" path="res://player/Player_Walk/Walk 1.png" id="2_hg6s5"] [ext_resource type="Texture2D" uid="uid://chxob4jg7qhqu" path="res://player/Player_Walk/Walk 2.png" id="3_8t03j"] -[ext_resource type="Texture2D" uid="uid://7asmyuhicfoj" path="res://player/attack_animation/Attack Animation 0.png" id="3_32hag"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_i3pqv"] +[ext_resource type="Texture2D" uid="uid://ds8mbsjrianb3" path="res://player/Attack animation 2/Attack animation 2 0.png" id="3_tqiix"] [ext_resource type="Texture2D" uid="uid://vwbnqmbol6hh" path="res://player/Player_Walk/Walk 3.png" id="4_2ieo8"] -[ext_resource type="Texture2D" uid="uid://c4klsmctmol5b" path="res://player/attack_animation/Attack Animation 1.png" id="4_tqiix"] +[ext_resource type="Texture2D" uid="uid://dxr4idwjaq4kx" path="res://player/Attack animation 2/Attack animation 2 1.png" id="4_e7oew"] [ext_resource type="PackedScene" uid="uid://d3e3kuyeh6mr1" path="res://player/sword.tscn" id="4_yw30f"] -[ext_resource type="Texture2D" uid="uid://c8xmypqf63l8f" path="res://player/attack_animation/Attack Animation 2.png" id="5_e7oew"] +[ext_resource type="Texture2D" uid="uid://doywx3flx6pvo" path="res://player/Attack animation 2/Attack animation 2 2.png" id="5_c35mf"] [ext_resource type="Texture2D" uid="uid://dawbam413fob" path="res://player/Player_Walk/Walk 4.png" id="5_ebec5"] -[ext_resource type="Texture2D" uid="uid://em1kmgnaikc1" path="res://player/attack_animation/Attack Animation 3.png" id="6_c35mf"] +[ext_resource type="Texture2D" uid="uid://bs8rolxcg4bib" path="res://player/Attack animation 2/Attack animation 2 3.png" id="6_65viv"] [ext_resource type="Texture2D" uid="uid://y32k1koww7oy" path="res://player/Player_Walk/Walk 5.png" id="6_yllr7"] [ext_resource type="Texture2D" uid="uid://bo7h3yc40kon3" path="res://player/Player_Walk/Walk 6.png" id="7_kb6p2"] +[ext_resource type="Texture2D" uid="uid://6su58pdrqqhd" path="res://player/Attack animation 2/Attack animation 2 4 .png" id="7_x7c3f"] [ext_resource type="PackedScene" uid="uid://beotdg4etmevc" path="res://player/double_jump/double_jump_animation.tscn" id="10_8t03j"] [ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="11_2ieo8"] [ext_resource type="AudioStream" uid="uid://ds0yw3au0quae" path="res://sounds/whoosh.mp3" id="12_ebec5"] @@ -24,26 +25,29 @@ animations = [{ "frames": [{ "duration": 1.0, -"texture": ExtResource("3_32hag") +"texture": ExtResource("3_tqiix") }, { "duration": 1.0, -"texture": ExtResource("4_tqiix") +"texture": ExtResource("4_e7oew") }, { "duration": 1.0, -"texture": ExtResource("5_e7oew") +"texture": ExtResource("5_c35mf") }, { "duration": 1.0, -"texture": ExtResource("6_c35mf") +"texture": ExtResource("6_65viv") +}, { +"duration": 1.0, +"texture": ExtResource("7_x7c3f") }], "loop": false, "name": &"attack", -"speed": 10.0 +"speed": 20.0 }, { "frames": [{ "duration": 1.0, "texture": ExtResource("2_hg6s5") }], -"loop": true, +"loop": false, "name": &"idle", "speed": 5.0 }, { @@ -86,7 +90,7 @@ shape = SubResource("CapsuleShape2D_onrkg") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] scale = Vector2(0.37, 0.37) sprite_frames = SubResource("SpriteFrames_dw050") -animation = &"idle" +animation = &"attack" [node name="EarthAligner" parent="." instance=ExtResource("3_i3pqv")] @@ -108,3 +112,4 @@ pitch_scale = 1.62 [node name="SwordSwingAudio" type="AudioStreamPlayer2D" parent="."] stream = ExtResource("17_tqiix") volume_db = -12.0 +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_attack_end"] diff --git a/traps/bear_trap.gd b/traps/bear_trap.gd index 8a074aa..50973e8 100644 --- a/traps/bear_trap.gd +++ b/traps/bear_trap.gd @@ -3,7 +3,7 @@ extends Trap @export var player_damage : int; @export var enemy_damage : int; - +var closed = false func damage_target(target: CollisionObject2D): if(target.get_collision_layer_value(3)): @@ -13,10 +13,20 @@ func damage_target(target: CollisionObject2D): func _on_area_2d_area_entered(area: Area2D) -> void: - damage_target(area) - queue_free() + if not closed: + damage_target(area) + closed = true + $AnimatedSprite2D.play("close") + await $AnimatedSprite2D.animation_finished + await get_tree().create_timer(0.1).timeout + queue_free() func _on_area_2d_body_entered(body: Node2D) -> void: - damage_target(body) - queue_free() + if not closed: + damage_target(body) + closed = true + $AnimatedSprite2D.play("close") + await $AnimatedSprite2D.animation_finished + await get_tree().create_timer(0.1).timeout + queue_free() diff --git a/traps/bear_trap.png b/traps/bear_trap.png new file mode 100644 index 0000000..15c87d8 Binary files /dev/null and b/traps/bear_trap.png differ diff --git a/traps/bear_trap.png.import b/traps/bear_trap.png.import new file mode 100644 index 0000000..162050c --- /dev/null +++ b/traps/bear_trap.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://iujiyx36vf62" +path="res://.godot/imported/bear_trap.png-96e0dc5d5000c7c52e451c81b6ba1b9a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://traps/bear_trap.png" +dest_files=["res://.godot/imported/bear_trap.png-96e0dc5d5000c7c52e451c81b6ba1b9a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/traps/bear_trap.tscn b/traps/bear_trap.tscn index c48e204..ab249e2 100644 --- a/traps/bear_trap.tscn +++ b/traps/bear_trap.tscn @@ -1,12 +1,31 @@ -[gd_scene load_steps=5 format=3 uid="uid://h3caql0b6vft"] +[gd_scene load_steps=8 format=3 uid="uid://h3caql0b6vft"] [ext_resource type="Script" uid="uid://dttgoqksqnsm0" path="res://traps/bear_trap.gd" id="1_u48ys"] -[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="2_mnxjq"] +[ext_resource type="Texture2D" uid="uid://72rbgxwnb0u4" path="res://traps/bear_trap_open.png" id="2_u17g6"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_mnxjq"] +[ext_resource type="Texture2D" uid="uid://ejor11sqt878" path="res://traps/bear_trap_closing.png" id="3_xgq7l"] +[ext_resource type="Texture2D" uid="uid://ci3qx0v5ksvjv" path="res://traps/bear_trap_closed.png" id="4_phfkt"] [sub_resource type="CircleShape2D" id="CircleShape2D_yh007"] radius = 30.0 +[sub_resource type="SpriteFrames" id="SpriteFrames_3n4a6"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_u17g6") +}, { +"duration": 1.0, +"texture": ExtResource("3_xgq7l") +}, { +"duration": 1.0, +"texture": ExtResource("4_phfkt") +}], +"loop": false, +"name": &"close", +"speed": 10.0 +}] + [node name="BearTrap" type="Node2D"] script = ExtResource("1_u48ys") player_damage = 2 @@ -21,10 +40,12 @@ position = Vector2(0, -15) scale = Vector2(1, 0.5) shape = SubResource("CircleShape2D_yh007") -[node name="Sprite2D" type="Sprite2D" parent="."] -self_modulate = Color(1, 0, 0, 1) -scale = Vector2(0.75, 0.1) -texture = ExtResource("2_mnxjq") +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +modulate = Color(2.1168277, 2.1168277, 2.1168277, 1) +position = Vector2(5.9604645e-08, -37.000004) +scale = Vector2(0.7, 0.7) +sprite_frames = SubResource("SpriteFrames_3n4a6") +animation = &"close" [node name="EarthAligner" parent="." instance=ExtResource("3_mnxjq")] diff --git a/traps/bear_trap_closed.png b/traps/bear_trap_closed.png new file mode 100644 index 0000000..d872623 Binary files /dev/null and b/traps/bear_trap_closed.png differ diff --git a/traps/bear_trap_closed.png.import b/traps/bear_trap_closed.png.import new file mode 100644 index 0000000..f241e10 --- /dev/null +++ b/traps/bear_trap_closed.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ci3qx0v5ksvjv" +path="res://.godot/imported/bear_trap_closed.png-ec30fe5f2fc4e7e6b04349aa4565872f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://traps/bear_trap_closed.png" +dest_files=["res://.godot/imported/bear_trap_closed.png-ec30fe5f2fc4e7e6b04349aa4565872f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/traps/bear_trap_closing.png b/traps/bear_trap_closing.png new file mode 100644 index 0000000..5a9b1cb Binary files /dev/null and b/traps/bear_trap_closing.png differ diff --git a/traps/bear_trap_closing.png.import b/traps/bear_trap_closing.png.import new file mode 100644 index 0000000..0153e6f --- /dev/null +++ b/traps/bear_trap_closing.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ejor11sqt878" +path="res://.godot/imported/bear_trap_closing.png-27c745ad7fa916989609834e4cc93f5c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://traps/bear_trap_closing.png" +dest_files=["res://.godot/imported/bear_trap_closing.png-27c745ad7fa916989609834e4cc93f5c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/traps/bear_trap_open.png b/traps/bear_trap_open.png new file mode 100644 index 0000000..1a53cf8 Binary files /dev/null and b/traps/bear_trap_open.png differ diff --git a/traps/bear_trap_open.png.import b/traps/bear_trap_open.png.import new file mode 100644 index 0000000..9766313 --- /dev/null +++ b/traps/bear_trap_open.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://72rbgxwnb0u4" +path="res://.godot/imported/bear_trap_open.png-30413991e9433940c05325ed0600af25.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://traps/bear_trap_open.png" +dest_files=["res://.godot/imported/bear_trap_open.png-30413991e9433940c05325ed0600af25.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/ui/initial_text/initial_text.tscn b/ui/initial_text/initial_text.tscn index f7c0428..8a3b35e 100644 --- a/ui/initial_text/initial_text.tscn +++ b/ui/initial_text/initial_text.tscn @@ -101,7 +101,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_ay53y") layout_mode = 2 theme = ExtResource("1_st7ea") bbcode_enabled = true -text = "They are hiding on the other side of the word — building towers to escape the rising [color=green] morass [/color]." +text = "They are hiding on the other side of the world — building towers to escape the rising [color=green] morass [/color]." horizontal_alignment = 1 vertical_alignment = 1 diff --git a/utils/Platform 1.png b/utils/Platform 1.png new file mode 100644 index 0000000..a56524e Binary files /dev/null and b/utils/Platform 1.png differ diff --git a/utils/Platform 1.png.import b/utils/Platform 1.png.import new file mode 100644 index 0000000..d9f1b47 --- /dev/null +++ b/utils/Platform 1.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b5v7fsww747vl" +path="res://.godot/imported/Platform 1.png-9cb190f099fbfbaead0eef4e06366e50.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://utils/Platform 1.png" +dest_files=["res://.godot/imported/Platform 1.png-9cb190f099fbfbaead0eef4e06366e50.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/utils/Platform 2.png b/utils/Platform 2.png new file mode 100644 index 0000000..7c4dcad Binary files /dev/null and b/utils/Platform 2.png differ diff --git a/utils/Platform 2.png.import b/utils/Platform 2.png.import new file mode 100644 index 0000000..7b8e277 --- /dev/null +++ b/utils/Platform 2.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://br11vkbla1yp0" +path="res://.godot/imported/Platform 2.png-afae43c285433ad902f6c15349191f7c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://utils/Platform 2.png" +dest_files=["res://.godot/imported/Platform 2.png-afae43c285433ad902f6c15349191f7c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/utils/platform.gd b/utils/platform.gd index 3c5dfda..ee867da 100644 --- a/utils/platform.gd +++ b/utils/platform.gd @@ -1,6 +1,11 @@ class_name Platform extends StaticBody2D var building +func _ready() -> void: + if(randf() > 0.5): + $Sprite2D.visible = true + $Sprite2D2.visible = false + func init_at_horizontal_distortion(distortion : float): scale.x *= distortion diff --git a/utils/platform.tscn b/utils/platform.tscn index a271e6c..65a3256 100644 --- a/utils/platform.tscn +++ b/utils/platform.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=5 format=3 uid="uid://4l3elvxpghw8"] +[gd_scene load_steps=6 format=3 uid="uid://4l3elvxpghw8"] [ext_resource type="Script" uid="uid://dwmquoam37sve" path="res://utils/platform.gd" id="1_c1gtx"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="2_c1gtx"] -[ext_resource type="Texture2D" uid="uid://dx1q5flmub36" path="res://utils/platform.png" id="2_olh5f"] +[ext_resource type="Texture2D" uid="uid://b5v7fsww747vl" path="res://utils/Platform 1.png" id="2_nh5rx"] +[ext_resource type="Texture2D" uid="uid://br11vkbla1yp0" path="res://utils/Platform 2.png" id="3_5pr7v"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_ry5bi"] size = Vector2(56, 6) @@ -18,8 +19,14 @@ one_way_collision = true one_way_collision_margin = 2.0 [node name="Sprite2D" type="Sprite2D" parent="."] -position = Vector2(-0.359969, 9.03226) -scale = Vector2(0.122334, 0.1) -texture = ExtResource("2_olh5f") +visible = false +position = Vector2(0.7199424, -0.64516133) +scale = Vector2(0.245, 0.245) +texture = ExtResource("2_nh5rx") + +[node name="Sprite2D2" type="Sprite2D" parent="."] +position = Vector2(0.7199424, -0.64516133) +scale = Vector2(0.245, 0.245) +texture = ExtResource("3_5pr7v") [node name="EarthAligner" parent="." instance=ExtResource("2_c1gtx")]