diff --git a/boss.gd b/boss.gd new file mode 100644 index 0000000..f5fb3e3 --- /dev/null +++ b/boss.gd @@ -0,0 +1,84 @@ +extends CharacterBody2D +@onready var earthaligner = $EarthAligner +@onready var player = get_tree().get_root().get_node("main/Player") +var moves = ["slam", "wave", "water_rise", "splash"] +@onready var next_move = choose_next_move() + +var risen = 0 +var attack_ready = true +var idle_dir : Vector2 = Vector2.ZERO +var idle_dir_remaining = 0 +var idle_move = true +var target_pos = Vector2.ZERO +var damage = 1 +signal grounded + +func choose_next_move() -> String: + if $EnemyHurtbox.hp < 2 * $EnemyHurtbox.max_hp / 3 and risen == 0: + risen += 1 + return "water_rise" + if $EnemyHurtbox.hp < $EnemyHurtbox.max_hp / 3 and risen == 1: + risen += 1 + return "water_rise" + return ["slam", "wave", "splash"].pick_random() + +func _physics_process(delta: float) -> void: + up_direction = earthaligner.global_from_local(Vector2.UP) + if attack_ready: + attack_ready = false + call(next_move) + next_move = choose_next_move() + + if(is_on_floor()): + grounded.emit() + + if idle_move: move_idle(delta) + if($Hitbox.overlaps_body(player)): + player.hurt(damage, self.position - player.position) + move_and_slide() + +func move_idle(delta : float): + idle_dir_remaining -= delta + if(idle_dir_remaining <= 0): + target_pos = player.position + player.earth_aligner.global_from_local(Vector2.UP) * 400 + target_pos += randf_range(0, max(200, (target_pos - global_position).length())*0.25) * Vector2.from_angle(randf_range(0,TAU)) + idle_dir = (target_pos - global_position).normalized()* max(200, (target_pos - global_position).length()) * 0.4 + idle_dir_remaining = 0.5 + velocity = idle_dir + +func slam(): + idle_move = false + velocity = up_direction * 500 + await get_tree().create_timer(0.6).timeout + damage = 2 + velocity = up_direction * -1500 + await grounded + destroy_below() + damage = 1 + velocity = up_direction * 500 + await get_tree().create_timer(0.3).timeout + damage = 2 + velocity = up_direction * -1500 + await grounded + destroy_below() + damage = 1 + velocity = up_direction * 35 + await get_tree().create_timer(3).timeout + idle_move = true + attack_ready = true + +func destroy_below(): + for body in $DestructionChecker.get_overlapping_bodies(): + if(body.has_method("destroy")): body.destroy() + +func wave(): + await get_tree().create_timer(4).timeout + attack_ready = true + +func water_rise(): + await get_tree().create_timer(4).timeout + attack_ready = true + +func splash(): + await get_tree().create_timer(4).timeout + attack_ready = true diff --git a/boss.gd.uid b/boss.gd.uid new file mode 100644 index 0000000..a40f64c --- /dev/null +++ b/boss.gd.uid @@ -0,0 +1 @@ +uid://uv672p8f4n6k diff --git a/boss.tscn b/boss.tscn new file mode 100644 index 0000000..4fca3b4 --- /dev/null +++ b/boss.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=7 format=3 uid="uid://cpe4s6vsn0ujd"] + +[ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost animation/Ghost 1.png" id="1_6xxrv"] +[ext_resource type="Script" uid="uid://uv672p8f4n6k" path="res://boss.gd" id="1_skx2t"] +[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_skx2t"] +[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="4_lnbgr"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_lnbgr"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_lnbgr"] +size = Vector2(300, 250) + +[node name="Boss" type="CharacterBody2D"] +collision_mask = 32 +script = ExtResource("1_skx2t") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +rotation = 1.5708 +scale = Vector2(10, 10) +shape = SubResource("CapsuleShape2D_lnbgr") + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(3.85156, 1.9375) +texture = ExtResource("1_6xxrv") + +[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("2_skx2t")] +collision_layer = 16 +collision_mask = 32 +max_hp = 600 +canvasItem = NodePath("..") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"] +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="."] +scale = Vector2(1.05, 1.05) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +rotation = 1.5708 +scale = Vector2(10, 10) +shape = SubResource("CapsuleShape2D_lnbgr") + +[node name="DestructionChecker" type="Area2D" parent="."] +collision_mask = 10 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DestructionChecker"] +position = Vector2(0, 200) +shape = SubResource("RectangleShape2D_lnbgr") diff --git a/buildings/Building 1x2 fixed.png.import b/buildings/Building 1x2 fixed.png.import index 39a81c9..0ac93ca 100644 --- a/buildings/Building 1x2 fixed.png.import +++ b/buildings/Building 1x2 fixed.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Building 1x2 fixed.png-e90afc0d25a8919ada5700 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 @@ -27,10 +25,6 @@ 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 diff --git a/buildings/Building 2x1 downside.png.import b/buildings/Building 2x1 downside.png.import index 0e57d53..52d9ce5 100644 --- a/buildings/Building 2x1 downside.png.import +++ b/buildings/Building 2x1 downside.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Building 2x1 downside.png-4b432eb4152bab7dd59 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 @@ -27,10 +25,6 @@ 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 diff --git a/buildings/Building 2x1 fixed.png.import b/buildings/Building 2x1 fixed.png.import index e7fdbe6..a78eae3 100644 --- a/buildings/Building 2x1 fixed.png.import +++ b/buildings/Building 2x1 fixed.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Building 2x1 fixed.png-b02748fa52aebae62f987c 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 @@ -27,10 +25,6 @@ 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 diff --git a/buildings/building.gd b/buildings/building.gd index 2bc7495..25f3686 100644 --- a/buildings/building.gd +++ b/buildings/building.gd @@ -4,6 +4,9 @@ class_name Building extends Node2D @export var dimension : Vector2i = Vector2(2, 1) # same as above @onready var grid : Grid = get_parent() +var objects = [] +var destroyed = false + # make sure location is set before adding a building to the scene tree # also make sure that the buildings are instantiated as children of the grid func _ready() -> void: @@ -14,7 +17,7 @@ func _ready() -> void: grid.buildings.append(self) - await get_tree().create_timer(0).timeout + await get_tree().create_timer(0.2).timeout if get_node_or_null("EnemyList") != null: var enemies = $EnemyList.get_children() @@ -23,6 +26,9 @@ func _ready() -> void: for enemy in enemies: var oldpos = enemy.position; enemy.position = get_world_position(oldpos) + if enemy is Platform or enemy is Trap or enemy is Item: + objects.append(enemy) + if "building" in enemy: enemy.building = self if(enemy.has_method("init_at_horizontal_distortion")): enemy.init_at_horizontal_distortion(enemy.position.length() / grid.ground_radius) @@ -43,4 +49,12 @@ func overlaps(other : Building): # If we get here, angles do not overlap return false - + +func destroy(): + if not destroyed: + grid.buildings.remove_at(grid.buildings.find(self)) + for object in objects: + if object != null and not ("collected" in object and object.collected): + object.queue_free() + destroyed = true + queue_free() diff --git a/buildings/room_bear_trap.tscn b/buildings/room_bear_trap.tscn index 5ecb49c..7f7edb6 100644 --- a/buildings/room_bear_trap.tscn +++ b/buildings/room_bear_trap.tscn @@ -39,18 +39,22 @@ position = Vector2(238, -149) [node name="Platform" parent="EnemyList" instance=ExtResource("8_evf2t")] visible = false position = Vector2(75, -285) +collision_layer = 41 [node name="Platform2" parent="EnemyList" instance=ExtResource("8_evf2t")] visible = false position = Vector2(225, -285) +collision_layer = 41 [node name="Platform3" parent="EnemyList" instance=ExtResource("8_evf2t")] visible = false position = Vector2(375, -285) +collision_layer = 41 [node name="Platform4" parent="EnemyList" instance=ExtResource("8_evf2t")] visible = false position = Vector2(525, -285) +collision_layer = 41 [node name="Platform5" parent="EnemyList" instance=ExtResource("8_evf2t")] position = Vector2(431, -150) diff --git a/buildings/room_haunted_house.tscn b/buildings/room_haunted_house.tscn index c77c51a..3c05dbb 100644 --- a/buildings/room_haunted_house.tscn +++ b/buildings/room_haunted_house.tscn @@ -33,10 +33,12 @@ position = Vector2(150, -300) [node name="Platform" parent="EnemyList" instance=ExtResource("6_e6j05")] visible = false position = Vector2(75, -585) +collision_layer = 41 [node name="Platform2" parent="EnemyList" instance=ExtResource("6_e6j05")] visible = false position = Vector2(225, -585) +collision_layer = 41 [node name="Platform3" parent="EnemyList" instance=ExtResource("6_e6j05")] position = Vector2(290, -431) diff --git a/buildings/room_pedastal.tscn b/buildings/room_pedastal.tscn index 0ab44d9..b55ab88 100644 --- a/buildings/room_pedastal.tscn +++ b/buildings/room_pedastal.tscn @@ -35,10 +35,12 @@ position = Vector2(-38, -481) [node name="Platform" parent="EnemyList" instance=ExtResource("6_caaff")] visible = false position = Vector2(75, -585) +collision_layer = 41 [node name="Platform2" parent="EnemyList" instance=ExtResource("6_caaff")] visible = false position = Vector2(225, -585) +collision_layer = 41 [node name="Platform3" parent="EnemyList" instance=ExtResource("6_caaff")] position = Vector2(5, -251) diff --git a/buildings/room_pedastal_mean.tscn b/buildings/room_pedastal_mean.tscn index b4b8592..223b6e0 100644 --- a/buildings/room_pedastal_mean.tscn +++ b/buildings/room_pedastal_mean.tscn @@ -32,10 +32,12 @@ script = ExtResource("4_ri5b7") [node name="Platform" parent="EnemyList" instance=ExtResource("6_kom4b")] visible = false position = Vector2(75, -585) +collision_layer = 41 [node name="Platform2" parent="EnemyList" instance=ExtResource("6_kom4b")] visible = false position = Vector2(225, -585) +collision_layer = 41 [node name="Platform5" parent="EnemyList" instance=ExtResource("6_kom4b")] position = Vector2(85, -287) diff --git a/buildings/room_temple.tscn b/buildings/room_temple.tscn index 4f7305e..47e0767 100644 --- a/buildings/room_temple.tscn +++ b/buildings/room_temple.tscn @@ -44,18 +44,22 @@ position = Vector2(118, -125) [node name="Platform" parent="EnemyList" instance=ExtResource("8_sifiv")] visible = false position = Vector2(75, -285) +collision_layer = 41 [node name="Platform2" parent="EnemyList" instance=ExtResource("8_sifiv")] visible = false position = Vector2(225, -285) +collision_layer = 41 [node name="Platform3" parent="EnemyList" instance=ExtResource("8_sifiv")] visible = false position = Vector2(375, -285) +collision_layer = 41 [node name="Platform4" parent="EnemyList" instance=ExtResource("8_sifiv")] visible = false position = Vector2(525, -285) +collision_layer = 41 [node name="Platform5" parent="EnemyList" instance=ExtResource("8_sifiv")] position = Vector2(300, -150) diff --git a/buildings/room_wide_item_above.tscn b/buildings/room_wide_item_above.tscn index 0193ecb..3fcf114 100644 --- a/buildings/room_wide_item_above.tscn +++ b/buildings/room_wide_item_above.tscn @@ -38,18 +38,22 @@ grid_offset = Vector2i(0, -1) [node name="Platform" parent="EnemyList" instance=ExtResource("6_me65q")] visible = false position = Vector2(75, -285) +collision_layer = 41 [node name="Platform2" parent="EnemyList" instance=ExtResource("6_me65q")] visible = false position = Vector2(225, -285) +collision_layer = 41 [node name="Platform3" parent="EnemyList" instance=ExtResource("6_me65q")] visible = false position = Vector2(375, -285) +collision_layer = 41 [node name="Platform4" parent="EnemyList" instance=ExtResource("6_me65q")] visible = false position = Vector2(525, -285) +collision_layer = 41 [node name="ItemSpawn" parent="EnemyList" instance=ExtResource("7_crruu")] position = Vector2(137, -329) diff --git a/destroy_area.gd b/destroy_area.gd new file mode 100644 index 0000000..1ac7731 --- /dev/null +++ b/destroy_area.gd @@ -0,0 +1,4 @@ +extends Area2D + +func destroy(): + get_parent().queue_free() diff --git a/destroy_area.gd.uid b/destroy_area.gd.uid new file mode 100644 index 0000000..4a20a7c --- /dev/null +++ b/destroy_area.gd.uid @@ -0,0 +1 @@ +uid://dwvb52u1hnx5m diff --git a/enemies/ghost animation/Ghost 0.png.import b/enemies/ghost animation/Ghost 0.png.import index 9aa9c33..1e7cd85 100644 --- a/enemies/ghost animation/Ghost 0.png.import +++ b/enemies/ghost animation/Ghost 0.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Ghost 0.png-54508e305bb055698e5019e1d53e16ab. 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 @@ -27,10 +25,6 @@ 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 diff --git a/enemies/ghost animation/Ghost 1.png.import b/enemies/ghost animation/Ghost 1.png.import index b1d0f88..305b740 100644 --- a/enemies/ghost animation/Ghost 1.png.import +++ b/enemies/ghost animation/Ghost 1.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Ghost 1.png-43131954ed622829dc5453ddf6a96b4c. 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 @@ -27,10 +25,6 @@ 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 diff --git a/enemies/ghost animation/Ghost 2.png.import b/enemies/ghost animation/Ghost 2.png.import index 87f2b9b..4ee80ea 100644 --- a/enemies/ghost animation/Ghost 2.png.import +++ b/enemies/ghost animation/Ghost 2.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Ghost 2.png-67077adaa01a71a5c0b85fac254bdf8e. 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 @@ -27,10 +25,6 @@ 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 diff --git a/enemies/ghost animation/Ghost 3.png.import b/enemies/ghost animation/Ghost 3.png.import index 5d4f743..932de75 100644 --- a/enemies/ghost animation/Ghost 3.png.import +++ b/enemies/ghost animation/Ghost 3.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Ghost 3.png-18da238556f83c92715d2db31a14d159. 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 @@ -27,10 +25,6 @@ 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 diff --git a/enemies/ghost animation/Ghost 4.png.import b/enemies/ghost animation/Ghost 4.png.import index 1ac4e37..8c6d724 100644 --- a/enemies/ghost animation/Ghost 4.png.import +++ b/enemies/ghost animation/Ghost 4.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Ghost 4.png-45ba6df3ef207a5eff72f5f0036139d6. 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 @@ -27,10 +25,6 @@ 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 diff --git a/enemies/ghost animation/Ghost 5.png.import b/enemies/ghost animation/Ghost 5.png.import index c47e6e7..98ac10c 100644 --- a/enemies/ghost animation/Ghost 5.png.import +++ b/enemies/ghost animation/Ghost 5.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Ghost 5.png-08f0125e59cfd0173a5d36d75efeae60. 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 @@ -27,10 +25,6 @@ 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 diff --git a/enemies/giant_leech.tscn b/enemies/giant_leech.tscn new file mode 100644 index 0000000..b6fe2ad --- /dev/null +++ b/enemies/giant_leech.tscn @@ -0,0 +1,62 @@ +[gd_scene load_steps=5 format=3 uid="uid://5nb7pf8g1ck"] + +[ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech.gd" id="1_wfsrb"] +[ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://segment.tscn" id="2_7ngsb"] +[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_vk62e"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"] +size = Vector2(2, 24) + +[node name="Giant_Leech" type="Node2D"] +scale = Vector2(1, 1.2) +script = ExtResource("1_wfsrb") +broadth = 400 +hp = 500 + +[node name="Segments" type="Node2D" parent="."] + +[node name="Segment0" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment2" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment3" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment4" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment5" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment6" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment7" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment8" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="Segment9" parent="Segments" instance=ExtResource("2_7ngsb")] +scale = Vector2(2, 2) + +[node name="EarthAligner" parent="." instance=ExtResource("3_vk62e")] + +[node name="RayCast2D" type="Area2D" parent="."] +position = Vector2(248, 31.2) +collision_layer = 0 +collision_mask = 8 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"] +position = Vector2(0, 14.8) +shape = SubResource("RectangleShape2D_cq6dk") + +[node name="RayCast2D2" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 8 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D2"] +position = Vector2(0, 14.8) +shape = SubResource("RectangleShape2D_cq6dk") diff --git a/enemies/leech.gd b/enemies/leech.gd index 54ccd38..cd346e0 100644 --- a/enemies/leech.gd +++ b/enemies/leech.gd @@ -12,6 +12,8 @@ var pause_time = 0.1 var iframes = 0.2 var iframe_time = 0 +var check_grounded_delay = 8 + func _ready() -> void: for segment in segments: segment.segment_damaged.connect(hurt) @@ -47,6 +49,10 @@ func _physics_process(delta: float) -> void: var segment_pos_data = calculate_segment_location_and_rotation(i) segments[i].position = segment_pos_data.position segments[i].rotation = segment_pos_data.rotation + if check_grounded_delay > 0: + check_grounded_delay -= delta + elif not $RayCast2D2.has_overlapping_bodies(): + queue_free() func calculate_segment_location_and_rotation (i) -> Dictionary: var aerial_end_location = Vector2.from_angle(-angle) * broadth diff --git a/enemies/leech.tscn b/enemies/leech.tscn index f377f49..7dfb6a1 100644 --- a/enemies/leech.tscn +++ b/enemies/leech.tscn @@ -8,7 +8,10 @@ size = Vector2(2, 24) [node name="Leech" type="Node2D"] +scale = Vector2(1, 1.2) script = ExtResource("1_6u582") +broadth = 200 +hp = 250 [node name="Segments" type="Node2D" parent="."] @@ -40,3 +43,11 @@ collision_mask = 8 [node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"] position = Vector2(0, 14.8) shape = SubResource("RectangleShape2D_cq6dk") + +[node name="RayCast2D2" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 8 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D2"] +position = Vector2(0, 14.8) +shape = SubResource("RectangleShape2D_cq6dk") diff --git a/items/active_items/bow/arrow.tscn b/items/active_items/bow/arrow.tscn index f4bb095..3f987d9 100644 --- a/items/active_items/bow/arrow.tscn +++ b/items/active_items/bow/arrow.tscn @@ -8,7 +8,7 @@ size = Vector2(20, 5) [node name="Arrow" type="Area2D"] collision_layer = 0 -collision_mask = 2 +collision_mask = 18 script = ExtResource("1_lxthq") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/items/generic/item.gd b/items/generic/item.gd index 4d7547a..0794e82 100644 --- a/items/generic/item.gd +++ b/items/generic/item.gd @@ -1,5 +1,6 @@ class_name Item extends Area2D @onready var player = get_tree().get_root().get_node_or_null("main/Player") +var collected = false func _physics_process(_delta: float) -> void: if(is_instance_valid(player) and overlaps_body(player)): @@ -8,6 +9,7 @@ func _physics_process(_delta: float) -> void: set_deferred("monitorable", false) call_deferred("reparent", player) collect_animation() + collected = true func collect_animation(): self.visible = false diff --git a/items/generic/item_spawn.tscn b/items/generic/item_spawn.tscn index 969ae9d..d707a22 100644 --- a/items/generic/item_spawn.tscn +++ b/items/generic/item_spawn.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://xj0of571aur1"] +[gd_scene load_steps=8 format=3 uid="uid://xj0of571aur1"] [ext_resource type="Script" uid="uid://b8em61mqgdi58" path="res://items/generic/item_spawn.gd" id="1_ms6tn"] [ext_resource type="PackedScene" uid="uid://b00185vygcka1" path="res://items/immediate_items/heal_item/heal_item.tscn" id="2_w6i8k"] @@ -6,11 +6,12 @@ [ext_resource type="PackedScene" uid="uid://gwctb2xqsbj" path="res://items/immediate_items/healthup/healthup.tscn" id="3_yi7ag"] [ext_resource type="PackedScene" uid="uid://ddn025xnjngko" path="res://items/active_items/bow/bow.tscn" id="4_v0ua0"] [ext_resource type="PackedScene" uid="uid://ewe36lqcjojk" path="res://items/active_items/updash/updash.tscn" id="5_uitgx"] +[ext_resource type="PackedScene" uid="uid://wc7kgtomy6xm" path="res://items/permanent_items/extrajump.tscn" id="6_xqgya"] [node name="ItemSpawn" type="Node2D"] script = ExtResource("1_ms6tn") common_items = Array[PackedScene]([ExtResource("2_w6i8k")]) -rare_items = Array[PackedScene]([ExtResource("4_v0ua0"), ExtResource("5_uitgx"), ExtResource("3_yi7ag")]) +rare_items = Array[PackedScene]([ExtResource("4_v0ua0"), ExtResource("5_uitgx"), ExtResource("3_yi7ag"), ExtResource("6_xqgya")]) unique_base_chance = 0.1 rare_base_chance = 0.3 metadata/_custom_type_script = "uid://b8em61mqgdi58" diff --git a/items/permanent_items/extrajump.gd b/items/permanent_items/extrajump.gd new file mode 100644 index 0000000..c0ac80f --- /dev/null +++ b/items/permanent_items/extrajump.gd @@ -0,0 +1,6 @@ +extends Item + +func collect() -> bool: + player.air_jumps_max += 1 + player.air_jumps_current += 1 + return true diff --git a/items/permanent_items/extrajump.gd.uid b/items/permanent_items/extrajump.gd.uid new file mode 100644 index 0000000..716abf9 --- /dev/null +++ b/items/permanent_items/extrajump.gd.uid @@ -0,0 +1 @@ +uid://bnr7cpjuvy6xj diff --git a/items/permanent_items/extrajump.tscn b/items/permanent_items/extrajump.tscn new file mode 100644 index 0000000..4c92225 --- /dev/null +++ b/items/permanent_items/extrajump.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=5 format=3 uid="uid://wc7kgtomy6xm"] + +[ext_resource type="Script" uid="uid://bnr7cpjuvy6xj" path="res://items/permanent_items/extrajump.gd" id="1_t7gtn"] +[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="2_70c5v"] +[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="3_qmwml"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_hvhjo"] + +[node name="ExtraJump" type="Area2D"] +scale = Vector2(1, -1) +script = ExtResource("1_t7gtn") + +[node name="EarthAligner" parent="." instance=ExtResource("2_70c5v")] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +scale = Vector2(7, 7) +shape = SubResource("CircleShape2D_hvhjo") + +[node name="Sprite2D" type="Sprite2D" parent="."] +modulate = Color(2.00392, 2.00392, 2.00392, 1) +texture = ExtResource("3_qmwml") diff --git a/main.tscn b/main.tscn index 69e0e51..f17786e 100644 --- a/main.tscn +++ b/main.tscn @@ -41,7 +41,7 @@ script = ExtResource("4_1bvp3") initial_buildings = 10 [node name="Timer" type="Timer" parent="Building Generator"] -wait_time = 2.5 +wait_time = 3.0 autostart = true [node name="CanvasLayer1" type="CanvasLayer" parent="."] @@ -68,6 +68,9 @@ script = ExtResource("8_5vw27") [node name="Leech" parent="." instance=ExtResource("9_kek77")] position = Vector2(0, -3015) +[node name="Boss" parent="." instance=ExtResource("10_4c57u")] +position = Vector2(0, -3500) + [node name="Water" parent="." instance=ExtResource("10_4c57u")] z_index = 15 diff --git a/player/Heart Grey.png.import b/player/Heart Grey.png.import index 4913ba6..4683b68 100644 --- a/player/Heart Grey.png.import +++ b/player/Heart Grey.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Heart Grey.png-6b86b8edc4802c3a483d9a14eb7ce1 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Heart.png.import b/player/Heart.png.import index dc7cbcd..38455ee 100644 --- a/player/Heart.png.import +++ b/player/Heart.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Heart.png-33902e9ff8206d83f93ea6d088b4a1bc.ct 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Heart_cut Grey.png.import b/player/Heart_cut Grey.png.import index be70c9d..31c6ef0 100644 --- a/player/Heart_cut Grey.png.import +++ b/player/Heart_cut Grey.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Heart_cut Grey.png-b4b9be15b5a8a36395d31eba43 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Heart_cut.png.import b/player/Heart_cut.png.import index fdc244b..1646dfd 100644 --- a/player/Heart_cut.png.import +++ b/player/Heart_cut.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Heart_cut.png-f11ef12fc6c55a0077b5ba659ce17ad 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Player_Walk/Walk 1.png.import b/player/Player_Walk/Walk 1.png.import index 7803358..97cf918 100644 --- a/player/Player_Walk/Walk 1.png.import +++ b/player/Player_Walk/Walk 1.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 1.png-47c623e9d3540b4a00d2bddf52ae0b2a.c 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Player_Walk/Walk 2.png.import b/player/Player_Walk/Walk 2.png.import index 3fac54f..48f18ef 100644 --- a/player/Player_Walk/Walk 2.png.import +++ b/player/Player_Walk/Walk 2.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 2.png-5dea4fdec55fa43e26680e08090fd654.c 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Player_Walk/Walk 3.png.import b/player/Player_Walk/Walk 3.png.import index c65053d..285ace3 100644 --- a/player/Player_Walk/Walk 3.png.import +++ b/player/Player_Walk/Walk 3.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 3.png-27890c0cb512383b8ecbd848c73efee1.c 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Player_Walk/Walk 4.png.import b/player/Player_Walk/Walk 4.png.import index c12f6b8..03aa90d 100644 --- a/player/Player_Walk/Walk 4.png.import +++ b/player/Player_Walk/Walk 4.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 4.png-232b1eae2acf3ad82130431014262cde.c 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Player_Walk/Walk 5.png.import b/player/Player_Walk/Walk 5.png.import index 47122be..fe3ebef 100644 --- a/player/Player_Walk/Walk 5.png.import +++ b/player/Player_Walk/Walk 5.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 5.png-cfb8eb15ace876127c083283fe74cdc0.c 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/Player_Walk/Walk 6.png.import b/player/Player_Walk/Walk 6.png.import index 5b2bdef..22d7868 100644 --- a/player/Player_Walk/Walk 6.png.import +++ b/player/Player_Walk/Walk 6.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Walk 6.png-f243f98e182be67eb8681a11d34ee554.c 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/attack_animation/Attack Animation 0.png.import b/player/attack_animation/Attack Animation 0.png.import index a1cb9cd..96e2c41 100644 --- a/player/attack_animation/Attack Animation 0.png.import +++ b/player/attack_animation/Attack Animation 0.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Attack Animation 0.png-489acc9ce1151ab08e3e3b 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/attack_animation/Attack Animation 1.png.import b/player/attack_animation/Attack Animation 1.png.import index d3c1bc7..3d443df 100644 --- a/player/attack_animation/Attack Animation 1.png.import +++ b/player/attack_animation/Attack Animation 1.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Attack Animation 1.png-ee24e1daff1b2693d0a213 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/attack_animation/Attack Animation 2.png.import b/player/attack_animation/Attack Animation 2.png.import index 9fb632f..8b1592c 100644 --- a/player/attack_animation/Attack Animation 2.png.import +++ b/player/attack_animation/Attack Animation 2.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Attack Animation 2.png-d547f6c17bbb65420b4918 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/attack_animation/Attack Animation 3.png.import b/player/attack_animation/Attack Animation 3.png.import index 0cc27c5..b0b138f 100644 --- a/player/attack_animation/Attack Animation 3.png.import +++ b/player/attack_animation/Attack Animation 3.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Attack Animation 3.png-d741f7f68a27aab201a287 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/double_jump/Double Jump 0.png.import b/player/double_jump/Double Jump 0.png.import index 40436aa..c685386 100644 --- a/player/double_jump/Double Jump 0.png.import +++ b/player/double_jump/Double Jump 0.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Double Jump 0.png-e1ba562e6b13c8446a336c30d2d 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/double_jump/Double Jump 1.png.import b/player/double_jump/Double Jump 1.png.import index 87b6af1..04b02df 100644 --- a/player/double_jump/Double Jump 1.png.import +++ b/player/double_jump/Double Jump 1.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Double Jump 1.png-69539f806c4752d0093ea6a956b 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/double_jump/Double Jump 2.png.import b/player/double_jump/Double Jump 2.png.import index 4818254..75d6760 100644 --- a/player/double_jump/Double Jump 2.png.import +++ b/player/double_jump/Double Jump 2.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Double Jump 2.png-f1a820e0078cf2a6b005cbe59b4 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/double_jump/Double Jump 3.png.import b/player/double_jump/Double Jump 3.png.import index 29d7306..ff6783f 100644 --- a/player/double_jump/Double Jump 3.png.import +++ b/player/double_jump/Double Jump 3.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Double Jump 3.png-4cfca0f35700bb4d12354620aff 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/double_jump/Double Jump 4.png.import b/player/double_jump/Double Jump 4.png.import index 2b6dfa0..cb7dc72 100644 --- a/player/double_jump/Double Jump 4.png.import +++ b/player/double_jump/Double Jump 4.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Double Jump 4.png-3e8f9f85498209cd3a65d2e632f 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 @@ -27,10 +25,6 @@ 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 diff --git a/player/sword.tscn b/player/sword.tscn index a6c432e..0ddd0b4 100644 --- a/player/sword.tscn +++ b/player/sword.tscn @@ -18,7 +18,7 @@ animations = [{ [node name="Sword" type="Area2D"] scale = Vector2(1.8, 1.8) -collision_mask = 2 +collision_mask = 18 script = ExtResource("1_hv1tj") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/project.godot b/project.godot index cfdd9be..73df7ee 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="The Dark Side of Earth" run/main_scene="uid://cxo6bq26huau7" -config/features=PackedStringArray("4.5", "Forward Plus") +config/features=PackedStringArray("4.4", "Forward Plus") config/icon="res://icon.svg" [display] @@ -69,3 +69,5 @@ drop_item={ 2d_physics/layer_2="EnemyHurtBox" 2d_physics/layer_3="PlayerHurtBox" 2d_physics/layer_4="SolidGround" +2d_physics/layer_5="EnemyHurtBoxNonTrap" +2d_physics/layer_6="TrulySolidGround" diff --git a/traps/Morning Star.png.import b/traps/Morning Star.png.import index 27c6bc9..5f48a13 100644 --- a/traps/Morning Star.png.import +++ b/traps/Morning Star.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Morning Star.png-5c8aa4aef917e837888eb86be042 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 @@ -27,10 +25,6 @@ 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 diff --git a/traps/bear_trap.gd b/traps/bear_trap.gd index ffdc37a..8a074aa 100644 --- a/traps/bear_trap.gd +++ b/traps/bear_trap.gd @@ -1,4 +1,4 @@ -extends Node2D +extends Trap @export var player_damage : int; @export var enemy_damage : int; diff --git a/traps/morning_star.gd b/traps/morning_star.gd index d54d909..6d5cf31 100644 --- a/traps/morning_star.gd +++ b/traps/morning_star.gd @@ -1,4 +1,4 @@ -extends Node2D +extends Trap @onready var ball : Area2D = $Area2D var anglespeed = 0.3 var player_damage = 1 diff --git a/traps/morning_star.tscn b/traps/morning_star.tscn index 8610aa2..49ac9d2 100644 --- a/traps/morning_star.tscn +++ b/traps/morning_star.tscn @@ -17,7 +17,7 @@ collision_layer = 0 collision_mask = 6 [node name="Sprite2D" type="Sprite2D" parent="Area2D"] -position = Vector2(1.9999962, 25.000004) +position = Vector2(2, 25) scale = Vector2(0.65, 0.65) texture = ExtResource("2_4n2t1") diff --git a/traps/trap.gd b/traps/trap.gd new file mode 100644 index 0000000..efb7649 --- /dev/null +++ b/traps/trap.gd @@ -0,0 +1 @@ +class_name Trap extends Node2D diff --git a/traps/trap.gd.uid b/traps/trap.gd.uid new file mode 100644 index 0000000..7b836ce --- /dev/null +++ b/traps/trap.gd.uid @@ -0,0 +1 @@ +uid://umx7q0tml2ul diff --git a/utils/enemy_hurtbox.gd b/utils/enemy_hurtbox.gd index bfd9eb6..33bd35f 100644 --- a/utils/enemy_hurtbox.gd +++ b/utils/enemy_hurtbox.gd @@ -26,3 +26,6 @@ func hurt(damage : int, dir : Vector2 = Vector2.ZERO): func die(): died.emit() + +func destroy(): + hurt(9999) diff --git a/utils/enemy_hurtbox.tscn b/utils/enemy_hurtbox.tscn index 4199894..a17c190 100644 --- a/utils/enemy_hurtbox.tscn +++ b/utils/enemy_hurtbox.tscn @@ -3,5 +3,5 @@ [ext_resource type="Script" uid="uid://ct8am2xeyymuj" path="res://utils/enemy_hurtbox.gd" id="1_wa58b"] [node name="EnemyHurtbox" type="Area2D"] -collision_layer = 2 +collision_layer = 18 script = ExtResource("1_wa58b") diff --git a/utils/platform.gd b/utils/platform.gd index 3747c56..3c5dfda 100644 --- a/utils/platform.gd +++ b/utils/platform.gd @@ -1,4 +1,8 @@ -extends StaticBody2D +class_name Platform extends StaticBody2D +var building func init_at_horizontal_distortion(distortion : float): scale.x *= distortion + +func destroy(): + building.destroy() diff --git a/world/Background Prototype/Background Prototype Layer 1.png.import b/world/Background Prototype/Background Prototype Layer 1.png.import index 2b3265d..3291c4a 100644 --- a/world/Background Prototype/Background Prototype Layer 1.png.import +++ b/world/Background Prototype/Background Prototype Layer 1.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Background Prototype Layer 1.png-47bb54b6d20a 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 @@ -27,10 +25,6 @@ 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 diff --git a/world/Background Prototype/Background Prototype Layer 2.png.import b/world/Background Prototype/Background Prototype Layer 2.png.import index f18ed3b..7415d89 100644 --- a/world/Background Prototype/Background Prototype Layer 2.png.import +++ b/world/Background Prototype/Background Prototype Layer 2.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Background Prototype Layer 2.png-ab86220f0fff 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 @@ -27,10 +25,6 @@ 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 diff --git a/world/Background Prototype/Background Prototype Layer 3.png.import b/world/Background Prototype/Background Prototype Layer 3.png.import index 816fbed..7399a52 100644 --- a/world/Background Prototype/Background Prototype Layer 3.png.import +++ b/world/Background Prototype/Background Prototype Layer 3.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Background Prototype Layer 3.png-5a49ea16a5dc 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 @@ -27,10 +25,6 @@ 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 diff --git a/world/Background Prototype/Background Prototype Layer 4.png.import b/world/Background Prototype/Background Prototype Layer 4.png.import index b465008..6ff53ad 100644 --- a/world/Background Prototype/Background Prototype Layer 4.png.import +++ b/world/Background Prototype/Background Prototype Layer 4.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Background Prototype Layer 4.png-ee5791549e67 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 @@ -27,10 +25,6 @@ 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 diff --git a/world/Background Prototype/Background prototype.png.import b/world/Background Prototype/Background prototype.png.import index ebf7d0f..c7895b7 100644 --- a/world/Background Prototype/Background prototype.png.import +++ b/world/Background Prototype/Background prototype.png.import @@ -18,8 +18,6 @@ dest_files=["res://.godot/imported/Background prototype.png-3a0b707a19d2bad45954 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 @@ -27,10 +25,6 @@ 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 diff --git a/world/earth.tscn b/world/earth.tscn index 1c63e6b..4e1311b 100644 --- a/world/earth.tscn +++ b/world/earth.tscn @@ -17,7 +17,7 @@ radius = 3000.0 script = ExtResource("1_wxnww") [node name="Ground" type="StaticBody2D" parent="."] -collision_layer = 9 +collision_layer = 41 [node name="CollisionShape2D" type="CollisionShape2D" parent="Ground"] shape = SubResource("CircleShape2D_5i67w")