From 267787c67ecd31d8fd0a4b3bfa45be8e49f3d789 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 17 Sep 2025 18:05:43 +0200 Subject: [PATCH] Performed a summoning ritual for initial buildings (also resized some sprites) --- buildings/Building 1x2 fixed.png.import | 6 ++++++ buildings/Building 2x1 downside.png.import | 6 ++++++ buildings/Building 2x1 fixed.png.import | 6 ++++++ enemies/ghost.tscn | 2 +- main.tscn | 23 ++++++++++++---------- player/Player_Walk/Walk 1.png.import | 6 ++++++ player/Player_Walk/Walk 2.png.import | 6 ++++++ player/Player_Walk/Walk 3.png.import | 6 ++++++ player/Player_Walk/Walk 4.png.import | 6 ++++++ player/Player_Walk/Walk 5.png.import | 6 ++++++ player/Player_Walk/Walk 6.png.import | 6 ++++++ player/sword.tscn | 2 +- project.godot | 2 +- show_fps.gd | 4 ++++ show_fps.gd.uid | 1 + world/building_generator.gd | 17 +++++++++++++--- 16 files changed, 89 insertions(+), 16 deletions(-) create mode 100644 show_fps.gd create mode 100644 show_fps.gd.uid diff --git a/buildings/Building 1x2 fixed.png.import b/buildings/Building 1x2 fixed.png.import index 0ac93ca..39a81c9 100644 --- a/buildings/Building 1x2 fixed.png.import +++ b/buildings/Building 1x2 fixed.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 52d9ce5..0e57d53 100644 --- a/buildings/Building 2x1 downside.png.import +++ b/buildings/Building 2x1 downside.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 a78eae3..e7fdbe6 100644 --- a/buildings/Building 2x1 fixed.png.import +++ b/buildings/Building 2x1 fixed.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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.tscn b/enemies/ghost.tscn index fd386d9..154c54a 100644 --- a/enemies/ghost.tscn +++ b/enemies/ghost.tscn @@ -25,7 +25,7 @@ shape = SubResource("CircleShape2D_6attn") texture = ExtResource("3_34o1m") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -scale = Vector2(6, 6) +scale = Vector2(5, 5) shape = SubResource("CircleShape2D_6attn") [node name="EarthAligner" parent="." instance=ExtResource("3_obmiq")] diff --git a/main.tscn b/main.tscn index 58f2916..ad64fb3 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://cxo6bq26huau7"] +[gd_scene load_steps=9 format=3 uid="uid://cxo6bq26huau7"] [ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"] [ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="2_lquwl"] @@ -7,17 +7,10 @@ [ext_resource type="PackedScene" uid="uid://73g8y37skebh" path="res://item_ui/item_ui.tscn" id="6_4c57u"] [ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"] [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"] [node name="main" type="Node2D"] -[node name="Layer0" type="Parallax2D" parent="."] - -[node name="Layer1" type="Parallax2D" parent="."] - -[node name="Layer2" type="Parallax2D" parent="."] - -[node name="Layer3" type="Parallax2D" parent="."] - [node name="Earth" parent="." instance=ExtResource("3_lquwl")] unique_name_in_owner = true script = ExtResource("2_lquwl") @@ -37,9 +30,10 @@ zoom = Vector2(0.12, 0.12) [node name="Building Generator" type="Node" parent="."] script = ExtResource("4_1bvp3") +initial_buildings = 10 [node name="Timer" type="Timer" parent="Building Generator"] -wait_time = 0.8 +wait_time = 2.5 autostart = true [node name="CanvasLayer" type="CanvasLayer" parent="."] @@ -54,6 +48,15 @@ player = NodePath("../../Player") [node name="DeathScreen" parent="CanvasLayer" instance=ExtResource("7_5vw27")] visible = false +[node name="FPS" type="Label" parent="CanvasLayer"] +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -40.0 +offset_bottom = 23.0 +grow_horizontal = 0 +script = ExtResource("8_5vw27") + [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"] diff --git a/player/Player_Walk/Walk 1.png.import b/player/Player_Walk/Walk 1.png.import index 97cf918..7803358 100644 --- a/player/Player_Walk/Walk 1.png.import +++ b/player/Player_Walk/Walk 1.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 48f18ef..3fac54f 100644 --- a/player/Player_Walk/Walk 2.png.import +++ b/player/Player_Walk/Walk 2.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 285ace3..c65053d 100644 --- a/player/Player_Walk/Walk 3.png.import +++ b/player/Player_Walk/Walk 3.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 03aa90d..c12f6b8 100644 --- a/player/Player_Walk/Walk 4.png.import +++ b/player/Player_Walk/Walk 4.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 fe3ebef..47122be 100644 --- a/player/Player_Walk/Walk 5.png.import +++ b/player/Player_Walk/Walk 5.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 22d7868..5b2bdef 100644 --- a/player/Player_Walk/Walk 6.png.import +++ b/player/Player_Walk/Walk 6.png.import @@ -18,6 +18,8 @@ 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 @@ -25,6 +27,10 @@ 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 14a7e43..a6c432e 100644 --- a/player/sword.tscn +++ b/player/sword.tscn @@ -24,7 +24,7 @@ script = ExtResource("1_hv1tj") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(-13, 5) rotation = 1.5708 -scale = Vector2(-0.3, -0.9) +scale = Vector2(-0.417, -0.985) shape = SubResource("CapsuleShape2D_e4ynd") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] diff --git a/project.godot b/project.godot index 78b48f8..c3e6702 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.4", "Forward Plus") +config/features=PackedStringArray("4.5", "Forward Plus") config/icon="res://icon.svg" [display] diff --git a/show_fps.gd b/show_fps.gd new file mode 100644 index 0000000..a67c61d --- /dev/null +++ b/show_fps.gd @@ -0,0 +1,4 @@ +extends Label + +func _process(_delta): + set_text("FPS " + str(Engine.get_frames_per_second())) diff --git a/show_fps.gd.uid b/show_fps.gd.uid new file mode 100644 index 0000000..beea4a6 --- /dev/null +++ b/show_fps.gd.uid @@ -0,0 +1 @@ +uid://3k6r3jnko4hg diff --git a/world/building_generator.gd b/world/building_generator.gd index 84598e4..30e9bb9 100644 --- a/world/building_generator.gd +++ b/world/building_generator.gd @@ -1,6 +1,7 @@ extends Node @onready var grid : Grid = %Earth.get_grid() +@export var initial_buildings : int; func random_oppostite_collumn() -> int: var playerpos = %Player.position @@ -12,12 +13,22 @@ func random_oppostite_collumn() -> int: return collumn +func random_collumn() -> int: + return randi_range(0, grid.num_collumns - 1) - +func _ready(): + for i in range(initial_buildings): + var collumn = random_collumn() + if 43 <= collumn and collumn <= 49: + continue + var building = randomize_building() + grid.add_building_to_collumn(building, collumn) func _on_timer_timeout() -> void: var collumn = random_oppostite_collumn() - var index = randi() % 2 - var building : Building = grid.packed_buildings[index].instantiate() + var building : Building = randomize_building() grid.add_building_to_collumn(building, collumn) +func randomize_building() -> Building: + var index = randi() % grid.packed_buildings.size() + return grid.packed_buildings[index].instantiate()