diff --git a/background/background.gd b/background/background.gd new file mode 100644 index 0000000..d4ec954 --- /dev/null +++ b/background/background.gd @@ -0,0 +1,5 @@ +extends Node2D + +#func _process(delta: float) -> void: + #for p : Parallax2D in get_children(): + #p.scroll_offset += Vector2.RIGHT * 100 * delta * p.scroll_scale diff --git a/background/background.gd.uid b/background/background.gd.uid new file mode 100644 index 0000000..fb6f298 --- /dev/null +++ b/background/background.gd.uid @@ -0,0 +1 @@ +uid://c6q1tgl7kag67 diff --git a/background/background.tscn b/background/background.tscn new file mode 100644 index 0000000..803f028 --- /dev/null +++ b/background/background.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=6 format=3 uid="uid://bcph46qvs6s1"] + +[ext_resource type="Script" uid="uid://c6q1tgl7kag67" path="res://background/background.gd" id="1_gsnt7"] +[ext_resource type="Texture2D" uid="uid://bk0lxjv2qjxnp" path="res://world/Background Prototype/Background Prototype Layer 1.png" id="1_qjy44"] +[ext_resource type="Texture2D" uid="uid://b3d276mpm5mqr" path="res://world/Background Prototype/Background Prototype Layer 4.png" id="2_eva80"] +[ext_resource type="Texture2D" uid="uid://b6fkgig57ki5j" path="res://world/Background Prototype/Background Prototype Layer 2.png" id="2_gsnt7"] +[ext_resource type="Texture2D" uid="uid://tctuwr3rmof4" path="res://world/Background Prototype/Background Prototype Layer 3.png" id="3_3phoi"] + +[node name="Background" type="Node2D"] +script = ExtResource("1_gsnt7") + +[node name="Parallax2D" type="Parallax2D" parent="."] +scroll_scale = Vector2(0.1, 0.1) +repeat_size = Vector2(1920, 1080) +repeat_times = 2 + +[node name="Sprite2D" type="Sprite2D" parent="Parallax2D"] +position = Vector2(960, 540) +scale = Vector2(2, 2) +texture = ExtResource("1_qjy44") + +[node name="Parallax2D2" type="Parallax2D" parent="."] +scroll_scale = Vector2(0.4, 0.4) +repeat_size = Vector2(1920, 1080) +repeat_times = 2 + +[node name="Sprite2D" type="Sprite2D" parent="Parallax2D2"] +position = Vector2(960, 540) +scale = Vector2(2, 2) +texture = ExtResource("2_gsnt7") + +[node name="Parallax2D3" type="Parallax2D" parent="."] +scroll_scale = Vector2(0.7, 0.7) +repeat_size = Vector2(1920, 1080) +repeat_times = 2 + +[node name="Sprite2D" type="Sprite2D" parent="Parallax2D3"] +position = Vector2(960, 540) +scale = Vector2(2, 2) +texture = ExtResource("3_3phoi") + +[node name="Parallax2D4" type="Parallax2D" parent="."] +repeat_size = Vector2(1920, 1080) +repeat_times = 2 + +[node name="Sprite2D" type="Sprite2D" parent="Parallax2D4"] +position = Vector2(960, 540) +scale = Vector2(2, 2) +texture = ExtResource("2_eva80") diff --git a/enemies/ghost animation/Ghost 0.png b/enemies/ghost animation/Ghost 0.png new file mode 100644 index 0000000..3185284 Binary files /dev/null and b/enemies/ghost animation/Ghost 0.png differ diff --git a/enemies/ghost animation/Ghost 0.png.import b/enemies/ghost animation/Ghost 0.png.import new file mode 100644 index 0000000..1e7cd85 --- /dev/null +++ b/enemies/ghost animation/Ghost 0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8732t0313bqs" +path="res://.godot/imported/Ghost 0.png-54508e305bb055698e5019e1d53e16ab.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://enemies/ghost animation/Ghost 0.png" +dest_files=["res://.godot/imported/Ghost 0.png-54508e305bb055698e5019e1d53e16ab.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/enemies/ghost animation/Ghost 1.png b/enemies/ghost animation/Ghost 1.png index 7360438..9240b58 100644 Binary files a/enemies/ghost animation/Ghost 1.png and b/enemies/ghost animation/Ghost 1.png differ diff --git a/enemies/ghost animation/Ghost 2.png b/enemies/ghost animation/Ghost 2.png index 3da1dc5..658d847 100644 Binary files a/enemies/ghost animation/Ghost 2.png and b/enemies/ghost animation/Ghost 2.png differ diff --git a/enemies/ghost.tscn b/enemies/ghost.tscn index af8a491..25223b0 100644 --- a/enemies/ghost.tscn +++ b/enemies/ghost.tscn @@ -1,13 +1,11 @@ -[gd_scene load_steps=11 format=3 uid="uid://chu67ci7sl488"] +[gd_scene load_steps=9 format=3 uid="uid://chu67ci7sl488"] [ext_resource type="Script" uid="uid://12jns4dppxxj" path="res://enemies/ghost.gd" id="1_6attn"] [ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_34o1m"] [ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost animation/Ghost 1.png" id="3_34o1m"] [ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_obmiq"] +[ext_resource type="Texture2D" uid="uid://b8732t0313bqs" path="res://enemies/ghost animation/Ghost 0.png" id="3_rbwoc"] [ext_resource type="Texture2D" uid="uid://dfhxhum8lek56" path="res://enemies/ghost animation/Ghost 2.png" id="4_4awot"] -[ext_resource type="Texture2D" uid="uid://ve5px6ib45g" path="res://enemies/ghost animation/Ghost 3.png" id="5_etobg"] -[ext_resource type="Texture2D" uid="uid://cmg8yws3gwx6u" path="res://enemies/ghost animation/Ghost 4.png" id="6_kbrsm"] -[ext_resource type="Texture2D" uid="uid://bs3lt13umfxu8" path="res://enemies/ghost animation/Ghost 5.png" id="7_a4rx2"] [sub_resource type="CircleShape2D" id="CircleShape2D_6attn"] @@ -15,19 +13,13 @@ animations = [{ "frames": [{ "duration": 1.0, +"texture": ExtResource("3_rbwoc") +}, { +"duration": 1.0, "texture": ExtResource("3_34o1m") }, { "duration": 1.0, "texture": ExtResource("4_4awot") -}, { -"duration": 1.0, -"texture": ExtResource("5_etobg") -}, { -"duration": 1.0, -"texture": ExtResource("6_kbrsm") -}, { -"duration": 1.0, -"texture": ExtResource("7_a4rx2") }], "loop": true, "name": &"default", diff --git a/main.tscn b/main.tscn index 3b744c5..f17786e 100644 --- a/main.tscn +++ b/main.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=11 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.png" id="3_kek77"] +[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"] [ext_resource type="PackedScene" uid="uid://jjoyj1ldafkf" path="res://world/earth.tscn" id="3_lquwl"] [ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="4_1bvp3"] [ext_resource type="PackedScene" uid="uid://73g8y37skebh" path="res://item_ui/item_ui.tscn" id="6_4c57u"] @@ -9,7 +9,7 @@ [ext_resource type="PackedScene" uid="uid://dpdn2php3ydsv" path="res://death_screen/death_screen.tscn" id="7_5vw27"] [ext_resource type="Script" uid="uid://3k6r3jnko4hg" path="res://show_fps.gd" id="8_5vw27"] [ext_resource type="PackedScene" uid="uid://b62xcg0dd3vct" path="res://enemies/leech.tscn" id="9_kek77"] -[ext_resource type="PackedScene" uid="uid://cpe4s6vsn0ujd" path="res://boss.tscn" id="10_4c57u"] +[ext_resource type="PackedScene" uid="uid://ca5ndobertnp4" path="res://water/water.tscn" id="10_4c57u"] [node name="main" type="Node2D"] @@ -44,19 +44,19 @@ initial_buildings = 10 wait_time = 3.0 autostart = true -[node name="CanvasLayer" type="CanvasLayer" parent="."] +[node name="CanvasLayer1" type="CanvasLayer" parent="."] -[node name="Healthbar" parent="CanvasLayer" instance=ExtResource("6_7mycd")] +[node name="Healthbar" parent="CanvasLayer1" instance=ExtResource("6_7mycd")] offset_right = 96.0 offset_bottom = 96.0 -[node name="ItemUI" parent="CanvasLayer" node_paths=PackedStringArray("player") instance=ExtResource("6_4c57u")] +[node name="ItemUI" parent="CanvasLayer1" node_paths=PackedStringArray("player") instance=ExtResource("6_4c57u")] player = NodePath("../../Player") -[node name="DeathScreen" parent="CanvasLayer" instance=ExtResource("7_5vw27")] +[node name="DeathScreen" parent="CanvasLayer1" instance=ExtResource("7_5vw27")] visible = false -[node name="FPS" type="Label" parent="CanvasLayer"] +[node name="FPS" type="Label" parent="CanvasLayer1"] anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 @@ -71,9 +71,23 @@ position = Vector2(0, -3015) [node name="Boss" parent="." instance=ExtResource("10_4c57u")] position = Vector2(0, -3500) -[connection signal="active_item_changed" from="Player" to="CanvasLayer/ItemUI" method="_on_player_active_item_changed"] -[connection signal="health_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_health_changed"] -[connection signal="max_hp_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_max_hp_changed"] -[connection signal="player_died" from="Player" to="CanvasLayer/DeathScreen" method="_on_player_player_died"] +[node name="Water" parent="." instance=ExtResource("10_4c57u")] +z_index = 15 + +[node name="CanvasLayer-1" type="CanvasLayer" parent="."] +layer = -1 + +[node name="ColorRect" type="TextureRect" parent="CanvasLayer-1"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("3_kek77") + +[connection signal="active_item_changed" from="Player" to="CanvasLayer1/ItemUI" method="_on_player_active_item_changed"] +[connection signal="health_changed" from="Player" to="CanvasLayer1/Healthbar" method="_on_player_health_changed"] +[connection signal="max_hp_changed" from="Player" to="CanvasLayer1/Healthbar" method="_on_player_max_hp_changed"] +[connection signal="player_died" from="Player" to="CanvasLayer1/DeathScreen" method="_on_player_player_died"] [connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"] -[connection signal="visibility_changed" from="CanvasLayer/DeathScreen" to="Player" method="_on_death_screen_visibility_changed"] +[connection signal="visibility_changed" from="CanvasLayer1/DeathScreen" to="Player" method="_on_death_screen_visibility_changed"] diff --git a/main_menu/main_menu.tscn b/main_menu/main_menu.tscn index faaf5f1..349f20d 100644 --- a/main_menu/main_menu.tscn +++ b/main_menu/main_menu.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=9 format=3 uid="uid://dpkr8yoobtej6"] +[gd_scene load_steps=10 format=3 uid="uid://dpkr8yoobtej6"] [ext_resource type="Script" uid="uid://bg4qx85we014d" path="res://main_menu/main_menu.gd" id="1_bws42"] [ext_resource type="PackedScene" uid="uid://jjoyj1ldafkf" path="res://world/earth.tscn" id="1_oa53l"] [ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="2_d3a7t"] [ext_resource type="Theme" uid="uid://dwlus1hjwtch4" path="res://large_theme.tres" id="3_3shxk"] +[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="5_3f7m4"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d3a7t"] bg_color = Color(0, 0.7529412, 0, 1) @@ -101,6 +102,17 @@ layout_mode = 2 theme_type_variation = &"FlatButton" text = "Quit Forever" +[node name="CanvasLayer-1" type="CanvasLayer" parent="."] +layer = -1 + +[node name="ColorRect" type="TextureRect" parent="CanvasLayer-1"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("5_3f7m4") + [connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"] [connection signal="pressed" from="CanvasLayer/Control/PanelContainer/ButtonStart" to="." method="_on_button_start_pressed"] [connection signal="pressed" from="CanvasLayer/Control/MarginContainer/PanelContainer/Button_Quit" to="." method="_on_button_quit_pressed"] diff --git a/player/attack_animation/Attack Animation 0.png b/player/attack_animation/Attack Animation 0.png new file mode 100644 index 0000000..de98156 Binary files /dev/null and b/player/attack_animation/Attack Animation 0.png differ diff --git a/player/attack_animation/Attack Animation 0.png.import b/player/attack_animation/Attack Animation 0.png.import new file mode 100644 index 0000000..96e2c41 --- /dev/null +++ b/player/attack_animation/Attack Animation 0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7asmyuhicfoj" +path="res://.godot/imported/Attack Animation 0.png-489acc9ce1151ab08e3e3b5b444c6f87.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/attack_animation/Attack Animation 0.png" +dest_files=["res://.godot/imported/Attack Animation 0.png-489acc9ce1151ab08e3e3b5b444c6f87.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/player/attack_animation/Attack Animation 1.png b/player/attack_animation/Attack Animation 1.png new file mode 100644 index 0000000..d0f78f6 Binary files /dev/null and b/player/attack_animation/Attack Animation 1.png differ diff --git a/player/attack_animation/Attack Animation 1.png.import b/player/attack_animation/Attack Animation 1.png.import new file mode 100644 index 0000000..3d443df --- /dev/null +++ b/player/attack_animation/Attack Animation 1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c4klsmctmol5b" +path="res://.godot/imported/Attack Animation 1.png-ee24e1daff1b2693d0a213bfef8b6a35.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/attack_animation/Attack Animation 1.png" +dest_files=["res://.godot/imported/Attack Animation 1.png-ee24e1daff1b2693d0a213bfef8b6a35.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/player/attack_animation/Attack Animation 2.png b/player/attack_animation/Attack Animation 2.png new file mode 100644 index 0000000..12ac8a3 Binary files /dev/null and b/player/attack_animation/Attack Animation 2.png differ diff --git a/player/attack_animation/Attack Animation 2.png.import b/player/attack_animation/Attack Animation 2.png.import new file mode 100644 index 0000000..8b1592c --- /dev/null +++ b/player/attack_animation/Attack Animation 2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8xmypqf63l8f" +path="res://.godot/imported/Attack Animation 2.png-d547f6c17bbb65420b4918144823411b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/attack_animation/Attack Animation 2.png" +dest_files=["res://.godot/imported/Attack Animation 2.png-d547f6c17bbb65420b4918144823411b.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/player/attack_animation/Attack Animation 3.png b/player/attack_animation/Attack Animation 3.png new file mode 100644 index 0000000..bed801e Binary files /dev/null and b/player/attack_animation/Attack Animation 3.png differ diff --git a/player/attack_animation/Attack Animation 3.png.import b/player/attack_animation/Attack Animation 3.png.import new file mode 100644 index 0000000..b0b138f --- /dev/null +++ b/player/attack_animation/Attack Animation 3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://em1kmgnaikc1" +path="res://.godot/imported/Attack Animation 3.png-d741f7f68a27aab201a287d419122401.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/attack_animation/Attack Animation 3.png" +dest_files=["res://.godot/imported/Attack Animation 3.png-d741f7f68a27aab201a287d419122401.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/player/double_jump/Double Jump 0.png b/player/double_jump/Double Jump 0.png new file mode 100644 index 0000000..038a208 Binary files /dev/null and b/player/double_jump/Double Jump 0.png differ diff --git a/player/double_jump/Double Jump 0.png.import b/player/double_jump/Double Jump 0.png.import new file mode 100644 index 0000000..c685386 --- /dev/null +++ b/player/double_jump/Double Jump 0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnnuplvwpo351" +path="res://.godot/imported/Double Jump 0.png-e1ba562e6b13c8446a336c30d2d5dd60.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/double_jump/Double Jump 0.png" +dest_files=["res://.godot/imported/Double Jump 0.png-e1ba562e6b13c8446a336c30d2d5dd60.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/player/double_jump/Double Jump 1.png b/player/double_jump/Double Jump 1.png new file mode 100644 index 0000000..6eab56f Binary files /dev/null and b/player/double_jump/Double Jump 1.png differ diff --git a/player/double_jump/Double Jump 1.png.import b/player/double_jump/Double Jump 1.png.import new file mode 100644 index 0000000..04b02df --- /dev/null +++ b/player/double_jump/Double Jump 1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bsx1yxgxv7rcy" +path="res://.godot/imported/Double Jump 1.png-69539f806c4752d0093ea6a956b823b9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/double_jump/Double Jump 1.png" +dest_files=["res://.godot/imported/Double Jump 1.png-69539f806c4752d0093ea6a956b823b9.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/player/double_jump/Double Jump 2.png b/player/double_jump/Double Jump 2.png new file mode 100644 index 0000000..ce69462 Binary files /dev/null and b/player/double_jump/Double Jump 2.png differ diff --git a/player/double_jump/Double Jump 2.png.import b/player/double_jump/Double Jump 2.png.import new file mode 100644 index 0000000..75d6760 --- /dev/null +++ b/player/double_jump/Double Jump 2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d4kk1kbnnvoiu" +path="res://.godot/imported/Double Jump 2.png-f1a820e0078cf2a6b005cbe59b43e27a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/double_jump/Double Jump 2.png" +dest_files=["res://.godot/imported/Double Jump 2.png-f1a820e0078cf2a6b005cbe59b43e27a.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/player/double_jump/Double Jump 3.png b/player/double_jump/Double Jump 3.png new file mode 100644 index 0000000..51a11da Binary files /dev/null and b/player/double_jump/Double Jump 3.png differ diff --git a/player/double_jump/Double Jump 3.png.import b/player/double_jump/Double Jump 3.png.import new file mode 100644 index 0000000..ff6783f --- /dev/null +++ b/player/double_jump/Double Jump 3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://btxj42ov7tlxx" +path="res://.godot/imported/Double Jump 3.png-4cfca0f35700bb4d12354620aff3aadf.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/double_jump/Double Jump 3.png" +dest_files=["res://.godot/imported/Double Jump 3.png-4cfca0f35700bb4d12354620aff3aadf.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/player/double_jump/Double Jump 4.png b/player/double_jump/Double Jump 4.png new file mode 100644 index 0000000..ef85d16 Binary files /dev/null and b/player/double_jump/Double Jump 4.png differ diff --git a/player/double_jump/Double Jump 4.png.import b/player/double_jump/Double Jump 4.png.import new file mode 100644 index 0000000..cb7dc72 --- /dev/null +++ b/player/double_jump/Double Jump 4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7mgi2hnujphy" +path="res://.godot/imported/Double Jump 4.png-3e8f9f85498209cd3a65d2e632f6e2da.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/double_jump/Double Jump 4.png" +dest_files=["res://.godot/imported/Double Jump 4.png-3e8f9f85498209cd3a65d2e632f6e2da.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/player/double_jump/double_jump_animation.gd b/player/double_jump/double_jump_animation.gd new file mode 100644 index 0000000..b6253c2 --- /dev/null +++ b/player/double_jump/double_jump_animation.gd @@ -0,0 +1,7 @@ +extends AnimatedSprite2D + +func _ready(): + play("default") + +func _on_animation_finished() -> void: + queue_free() diff --git a/player/double_jump/double_jump_animation.gd.uid b/player/double_jump/double_jump_animation.gd.uid new file mode 100644 index 0000000..868f770 --- /dev/null +++ b/player/double_jump/double_jump_animation.gd.uid @@ -0,0 +1 @@ +uid://courx3cleht2d diff --git a/player/double_jump/double_jump_animation.tscn b/player/double_jump/double_jump_animation.tscn new file mode 100644 index 0000000..b758794 --- /dev/null +++ b/player/double_jump/double_jump_animation.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=8 format=3 uid="uid://beotdg4etmevc"] + +[ext_resource type="Texture2D" uid="uid://cnnuplvwpo351" path="res://player/double_jump/Double Jump 0.png" id="1_x551h"] +[ext_resource type="Texture2D" uid="uid://bsx1yxgxv7rcy" path="res://player/double_jump/Double Jump 1.png" id="2_q6kgq"] +[ext_resource type="Texture2D" uid="uid://d4kk1kbnnvoiu" path="res://player/double_jump/Double Jump 2.png" id="3_d5r54"] +[ext_resource type="Texture2D" uid="uid://btxj42ov7tlxx" path="res://player/double_jump/Double Jump 3.png" id="4_sevse"] +[ext_resource type="Texture2D" uid="uid://7mgi2hnujphy" path="res://player/double_jump/Double Jump 4.png" id="5_2o7pi"] +[ext_resource type="Script" uid="uid://courx3cleht2d" path="res://player/double_jump/double_jump_animation.gd" id="6_q6kgq"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_qajm0"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_x551h") +}, { +"duration": 1.0, +"texture": ExtResource("2_q6kgq") +}, { +"duration": 1.0, +"texture": ExtResource("3_d5r54") +}, { +"duration": 1.0, +"texture": ExtResource("4_sevse") +}, { +"duration": 1.0, +"texture": ExtResource("5_2o7pi") +}], +"loop": false, +"name": &"default", +"speed": 10.0 +}] + +[node name="DoubleJumpAnimation" type="AnimatedSprite2D"] +sprite_frames = SubResource("SpriteFrames_qajm0") +frame_progress = 0.30051297 +script = ExtResource("6_q6kgq") + +[connection signal="animation_finished" from="." to="." method="_on_animation_finished"] diff --git a/player/player.gd b/player/player.gd index 288808b..0da6cdc 100644 --- a/player/player.gd +++ b/player/player.gd @@ -6,6 +6,8 @@ class_name Player extends CharacterBody2D @onready var sword : Area2D = $Sword; @onready var active_item_cooldown : Timer = $ActiveItemCooldown +@export var double_jump_animation : PackedScene + # allow taking away player control var handle_input : bool = true @@ -131,6 +133,7 @@ func manage_velocity(delta: float) -> void: var dropped = false if(not is_on_floor()): air_jumps_current -= 1; + play_double_jump_animation() elif (Input.is_action_pressed("drop")): dropped = true self.position += earth_aligner.global_from_local(Vector2(0,3)) @@ -163,3 +166,10 @@ func die(): func _on_death_screen_visibility_changed() -> void: handle_input = !handle_input + +func play_double_jump_animation() -> void: + var node = double_jump_animation.instantiate() + add_child(node) + node.position = Vector2(0, 5) + node.scale = .5 * Vector2.ONE + node.reparent(get_parent()) diff --git a/player/player.tscn b/player/player.tscn index 7297c6b..785c4f1 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://cmaovvr15b3qk"] +[gd_scene load_steps=13 format=3 uid="uid://cmaovvr15b3qk"] [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"] @@ -9,6 +9,7 @@ [ext_resource type="Texture2D" uid="uid://dawbam413fob" path="res://player/Player_Walk/Walk 4.png" id="5_ebec5"] [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="PackedScene" uid="uid://beotdg4etmevc" path="res://player/double_jump/double_jump_animation.tscn" id="10_8t03j"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_onrkg"] @@ -43,6 +44,7 @@ z_index = 10 collision_layer = 5 safe_margin = 1.0 script = ExtResource("1_4flbx") +double_jump_animation = ExtResource("10_8t03j") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(0, 5.6) diff --git a/project.godot b/project.godot index 7ff94d8..73df7ee 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="The Dark Side of Earth" -run/main_scene="uid://dpkr8yoobtej6" +run/main_scene="uid://cxo6bq26huau7" config/features=PackedStringArray("4.4", "Forward Plus") config/icon="res://icon.svg" diff --git a/traps/Morning Star.png b/traps/Morning Star.png new file mode 100644 index 0000000..acc7efb Binary files /dev/null and b/traps/Morning Star.png differ diff --git a/traps/Morning Star.png.import b/traps/Morning Star.png.import new file mode 100644 index 0000000..5f48a13 --- /dev/null +++ b/traps/Morning Star.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c2q6afspf7hdq" +path="res://.godot/imported/Morning Star.png-5c8aa4aef917e837888eb86be042d0ec.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://traps/Morning Star.png" +dest_files=["res://.godot/imported/Morning Star.png-5c8aa4aef917e837888eb86be042d0ec.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/traps/morning_star.tscn b/traps/morning_star.tscn index c9edd82..49ac9d2 100644 --- a/traps/morning_star.tscn +++ b/traps/morning_star.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=4 format=3 uid="uid://dpv1w56yr1xue"] [ext_resource type="Script" uid="uid://bjarfrf4tf3b1" path="res://traps/morning_star.gd" id="1_iuq6u"] -[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_ytaxb"] +[ext_resource type="Texture2D" uid="uid://c2q6afspf7hdq" path="res://traps/Morning Star.png" id="2_4n2t1"] [sub_resource type="CircleShape2D" id="CircleShape2D_iuq6u"] +radius = 12.5 [node name="MorningStar" type="Node2D"] z_index = 2 @@ -15,10 +16,10 @@ scale = Vector2(3, 3) collision_layer = 0 collision_mask = 6 +[node name="Sprite2D" type="Sprite2D" parent="Area2D"] +position = Vector2(2, 25) +scale = Vector2(0.65, 0.65) +texture = ExtResource("2_4n2t1") + [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] shape = SubResource("CircleShape2D_iuq6u") - -[node name="Sprite2D" type="Sprite2D" parent="Area2D"] -modulate = Color(1, 0, 0, 1) -scale = Vector2(0.15, 0.15) -texture = ExtResource("1_ytaxb") diff --git a/water/tsunami.res b/water/tsunami.res new file mode 100644 index 0000000..bd9f37d Binary files /dev/null and b/water/tsunami.res differ diff --git a/water/water.gd b/water/water.gd new file mode 100644 index 0000000..3f1e73e --- /dev/null +++ b/water/water.gd @@ -0,0 +1,92 @@ +extends Node2D + +signal water_reached_max_height + +var radius : float: + set(new_radius): + radius = new_radius + var mesh = get_node_or_null("WaterMesh") + if !is_instance_valid(mesh): + return + update_scale(mesh) + mesh.material.set_shader_parameter("radius", radius) + +@export var amplitude : float: + set(new_amplitude): + amplitude = new_amplitude + var mesh = get_node_or_null("WaterMesh") + if !is_instance_valid(mesh): + return + update_scale(mesh) + mesh.material.set_shader_parameter("amplitude", amplitude) + +@export var tsunami_size : float: + set(new_size): + tsunami_size = new_size + var mesh = get_node_or_null("WaterMesh") + if !is_instance_valid(mesh): + return + update_scale(mesh) + mesh.material.set_shader_parameter("tsunami_size", tsunami_size) + +var tsunami_angle : float: + set(new_angle): + tsunami_angle = new_angle + var mesh = get_node_or_null("WaterMesh") + if !is_instance_valid(mesh): + return + update_scale(mesh) + mesh.material.set_shader_parameter("tsunami_angle", tsunami_angle) + +@export var animation_angle : float = 0 +@export var tsunami_base_angle : float + +@export var rise_from : float = 2500; +@export var rise_to : float = 3500; +@export var rise_time : float = 120; # in seconds +var auto_rise : bool = true; + +@onready var start_unix_time : float = Time.get_unix_time_from_system() +var direction = 1; + +func update_scale(mesh): + mesh.scale = 2 * (radius + amplitude * 2.1 + tsunami_size) * Vector2.ONE + +func update_shader(): + radius = radius + amplitude = amplitude + tsunami_angle = tsunami_angle + tsunami_size = tsunami_size + +func _ready() -> void: + update_shader() + radius = rise_from + auto_rise = false + radius = 2950; + create_tsunami(4.712, 1); + await get_tree().create_timer(10).timeout + create_tsunami(4.712, 1); + + +func _process(_delta: float) -> void: + if auto_rise: + var time: float = Time.get_unix_time_from_system() + if time - start_unix_time > rise_time: + auto_rise = false + radius = rise_to + water_reached_max_height.emit() + else: + radius = lerpf(rise_from, rise_to, (time - start_unix_time) / rise_time) + + if $Tsunami.is_playing(): + tsunami_angle = tsunami_base_angle + animation_angle * direction; + + # direction is -1 for left, +1 for right +func create_tsunami(angle : float, dir : int): + if direction not in [-1, 1]: + push_error("direction must be in {-1, 1}") + return + direction = dir + tsunami_base_angle = angle; + + $Tsunami.play("tsunami") diff --git a/water/water.gd.uid b/water/water.gd.uid new file mode 100644 index 0000000..e7e0e09 --- /dev/null +++ b/water/water.gd.uid @@ -0,0 +1 @@ +uid://chcxmo2uqvjbm diff --git a/water/water.gdshader b/water/water.gdshader new file mode 100644 index 0000000..c3bf411 --- /dev/null +++ b/water/water.gdshader @@ -0,0 +1,49 @@ +shader_type canvas_item; + +varying vec2 world_position; +uniform vec4 color : source_color; +uniform float radius = 3000; +uniform float amplitude = 20; + +uniform float tsunami_size = 0; +uniform float tsunami_angle = 0; + +void vertex() { + world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy; +} + +float wave_at(float angle) { + float wave1 = amplitude/1. * sin(150. * angle + TIME); + float wave2 = amplitude/2. * sin(90. * angle + 1.6 * TIME); + float wave3 = amplitude/3. * sin(55. * angle + 2.3 * TIME); + float wave4 = amplitude/4. * sin(35. * angle + 3.9 * TIME); + return wave1 + wave2 + wave3 + wave4; +} + +float tsunami_at(float angle) { + float angle_diff = angle - tsunami_angle; + angle_diff = mod(angle_diff + PI + TAU, TAU) - PI; + float sinc = (sin(20. * angle_diff) / angle_diff/ 20.); + float wave = pow(abs(sinc), 1.5) * tsunami_size * sign(sinc); + return wave; +} + + +void fragment() { + float angle = atan(world_position.y, world_position.x); + float wave = wave_at(angle); + float tsunami = tsunami_at(angle); + + if(length(world_position) < radius + wave + tsunami) { + COLOR = color; + } else { + discard; + } +} + + + +//void light() { +// // Called for every pixel for every light affecting the CanvasItem. +// // Uncomment to replace the default light processing function with this one. +//} diff --git a/water/water.gdshader.uid b/water/water.gdshader.uid new file mode 100644 index 0000000..7868bef --- /dev/null +++ b/water/water.gdshader.uid @@ -0,0 +1 @@ +uid://dg6cmhincvxua diff --git a/water/water.tscn b/water/water.tscn new file mode 100644 index 0000000..58133f3 --- /dev/null +++ b/water/water.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=8 format=3 uid="uid://ca5ndobertnp4"] + +[ext_resource type="Script" uid="uid://chcxmo2uqvjbm" path="res://water/water.gd" id="1_m8een"] +[ext_resource type="Shader" uid="uid://dg6cmhincvxua" path="res://water/water.gdshader" id="1_wjap7"] +[ext_resource type="Animation" uid="uid://y1u85w0ew7uj" path="res://water/tsunami.res" id="3_6c1kg"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_m8een"] +shader = ExtResource("1_wjap7") +shader_parameter/color = Color(0, 0.49803922, 0, 1) +shader_parameter/radius = 3000.0 +shader_parameter/amplitude = 20.0 +shader_parameter/tsunami_size = 0.0 +shader_parameter/tsunami_angle = 0.0 + +[sub_resource type="QuadMesh" id="QuadMesh_6c1kg"] + +[sub_resource type="Animation" id="Animation_6c1kg"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:tsunami_size") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:animation_angle") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_6c1kg"] +_data = { +&"RESET": SubResource("Animation_6c1kg"), +&"tsunami": ExtResource("3_6c1kg") +} + +[node name="Water" type="Node2D"] +script = ExtResource("1_m8een") +amplitude = 20.0 +tsunami_base_angle = 4.712 +rise_from = 2400.0 +rise_to = 4200.0 +rise_time = 900.0 + +[node name="WaterMesh" type="MeshInstance2D" parent="."] +unique_name_in_owner = true +material = SubResource("ShaderMaterial_m8een") +scale = Vector2(10000, 10000) +mesh = SubResource("QuadMesh_6c1kg") + +[node name="Tsunami" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_6c1kg") +} diff --git a/world/Background prototype.png b/world/Background Prototype/Background prototype.png similarity index 100% rename from world/Background prototype.png rename to world/Background Prototype/Background prototype.png diff --git a/world/Background prototype.png.import b/world/Background Prototype/Background prototype.png.import similarity index 67% rename from world/Background prototype.png.import rename to world/Background Prototype/Background prototype.png.import index c64e0d8..c7895b7 100644 --- a/world/Background prototype.png.import +++ b/world/Background Prototype/Background prototype.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d3fpq76anm4t7" -path="res://.godot/imported/Background prototype.png-82410769bb8789c49aff3e49453fc3fe.ctex" +path="res://.godot/imported/Background prototype.png-3a0b707a19d2bad459544182fdfe35b0.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://world/Background prototype.png" -dest_files=["res://.godot/imported/Background prototype.png-82410769bb8789c49aff3e49453fc3fe.ctex"] +source_file="res://world/Background Prototype/Background prototype.png" +dest_files=["res://.godot/imported/Background prototype.png-3a0b707a19d2bad459544182fdfe35b0.ctex"] [params]