From accf24ea08dde8240cb2ed69507a80ccfdcb6f88 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 17 Sep 2025 19:25:22 +0200 Subject: [PATCH] Added Main Menu --- building_generator.tscn | 13 ++++ buildings/building.gd | 7 +- enemies/ghost animation/Ghost 1.png.import | 6 ++ enemies/ghost animation/Ghost 2.png.import | 6 ++ enemies/ghost animation/Ghost 3.png.import | 6 ++ enemies/ghost animation/Ghost 4.png.import | 6 ++ enemies/ghost animation/Ghost 5.png.import | 6 ++ enemies/ghost.gd | 4 +- items/bow.tscn | 5 +- items/item.gd | 7 +- items/updash.tscn | 5 +- main.tscn | 4 +- main_menu/main_menu.gd | 6 ++ main_menu/main_menu.gd.uid | 1 + main_menu/main_menu.tscn | 73 +++++++++++++++++++ player/Heart Grey.png.import | 6 ++ player/Heart.png.import | 6 ++ player/Heart_cut Grey.png.import | 6 ++ player/Heart_cut.png.import | 6 ++ project.godot | 2 +- .../Background Prototype Layer 1.png.import | 6 ++ .../Background Prototype Layer 2.png.import | 6 ++ .../Background Prototype Layer 3.png.import | 6 ++ .../Background Prototype Layer 4.png.import | 6 ++ world/Background prototype.png.import | 6 ++ world/building_generator.gd | 5 +- world/earth.tscn | 4 +- 27 files changed, 205 insertions(+), 15 deletions(-) create mode 100644 building_generator.tscn create mode 100644 main_menu/main_menu.gd create mode 100644 main_menu/main_menu.gd.uid create mode 100644 main_menu/main_menu.tscn diff --git a/building_generator.tscn b/building_generator.tscn new file mode 100644 index 0000000..99aa6c3 --- /dev/null +++ b/building_generator.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=3 uid="uid://ceg7ahpj5x12g"] + +[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="1_cwnke"] + +[node name="Building Generator" type="Node"] +script = ExtResource("1_cwnke") +initial_buildings = 10 + +[node name="Timer" type="Timer" parent="."] +wait_time = 2.5 +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/buildings/building.gd b/buildings/building.gd index 259d82e..2bc7495 100644 --- a/buildings/building.gd +++ b/buildings/building.gd @@ -16,9 +16,12 @@ func _ready() -> void: await get_tree().create_timer(0).timeout if get_node_or_null("EnemyList") != null: - for enemy in $EnemyList.get_children(): + var enemies = $EnemyList.get_children() + + $EnemyList.reparent(get_tree().get_root().get_node("main"), false) + + for enemy in enemies: var oldpos = enemy.position; - enemy.reparent(get_tree().get_root().get_node("main")) enemy.position = get_world_position(oldpos) if(enemy.has_method("init_at_horizontal_distortion")): enemy.init_at_horizontal_distortion(enemy.position.length() / grid.ground_radius) diff --git a/enemies/ghost animation/Ghost 1.png.import b/enemies/ghost animation/Ghost 1.png.import index 305b740..b1d0f88 100644 --- a/enemies/ghost animation/Ghost 1.png.import +++ b/enemies/ghost animation/Ghost 1.png.import @@ -18,6 +18,8 @@ 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 @@ -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 animation/Ghost 2.png.import b/enemies/ghost animation/Ghost 2.png.import index 4ee80ea..87f2b9b 100644 --- a/enemies/ghost animation/Ghost 2.png.import +++ b/enemies/ghost animation/Ghost 2.png.import @@ -18,6 +18,8 @@ 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 @@ -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 animation/Ghost 3.png.import b/enemies/ghost animation/Ghost 3.png.import index 932de75..5d4f743 100644 --- a/enemies/ghost animation/Ghost 3.png.import +++ b/enemies/ghost animation/Ghost 3.png.import @@ -18,6 +18,8 @@ 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 @@ -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 animation/Ghost 4.png.import b/enemies/ghost animation/Ghost 4.png.import index 8c6d724..1ac4e37 100644 --- a/enemies/ghost animation/Ghost 4.png.import +++ b/enemies/ghost animation/Ghost 4.png.import @@ -18,6 +18,8 @@ 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 @@ -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 animation/Ghost 5.png.import b/enemies/ghost animation/Ghost 5.png.import index 98ac10c..c47e6e7 100644 --- a/enemies/ghost animation/Ghost 5.png.import +++ b/enemies/ghost animation/Ghost 5.png.import @@ -18,6 +18,8 @@ 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 @@ -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.gd b/enemies/ghost.gd index bb3cfde..698b8f8 100644 --- a/enemies/ghost.gd +++ b/enemies/ghost.gd @@ -11,9 +11,11 @@ var aggro_range = 900 var chase_range = 1400 func _ready() -> void: - player = get_tree().get_root().get_node("main/Player") + player = get_tree().get_root().get_node_or_null("main/Player") func _physics_process(delta: float) -> void: + if !is_instance_valid(player): + return var dist = (position - player.position).length() if(dist > chase_range): diff --git a/items/bow.tscn b/items/bow.tscn index 457a3bd..1062660 100644 --- a/items/bow.tscn +++ b/items/bow.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=5 format=3 uid="uid://ddn025xnjngko"] +[gd_scene load_steps=6 format=3 uid="uid://ddn025xnjngko"] [ext_resource type="Script" uid="uid://bkcip66at5sug" path="res://items/bow.gd" id="1_xppub"] [ext_resource type="PackedScene" uid="uid://dfva4dhflxglr" path="res://items/arrow.tscn" id="2_0id2q"] [ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="2_gllxn"] +[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="4_0id2q"] [sub_resource type="CircleShape2D" id="CircleShape2D_gllxn"] @@ -13,6 +14,8 @@ script = ExtResource("1_xppub") arrow_scene = ExtResource("2_0id2q") sprite = ExtResource("2_gllxn") +[node name="EarthAligner" parent="." instance=ExtResource("4_0id2q")] + [node name="CollisionShape2D" type="CollisionShape2D" parent="."] scale = Vector2(3.1, 3.1) shape = SubResource("CircleShape2D_gllxn") diff --git a/items/item.gd b/items/item.gd index 43e8541..4d7547a 100644 --- a/items/item.gd +++ b/items/item.gd @@ -1,8 +1,8 @@ class_name Item extends Area2D -@onready var player = get_tree().get_root().get_node("main/Player") +@onready var player = get_tree().get_root().get_node_or_null("main/Player") -func _physics_process(delta: float) -> void: - if(overlaps_body(player)): +func _physics_process(_delta: float) -> void: + if(is_instance_valid(player) and overlaps_body(player)): if(self.has_method("collect") and collect()): set_deferred("monitoring", false) set_deferred("monitorable", false) @@ -14,3 +14,4 @@ func collect_animation(): func collect(): push_error("Please specify item collection behavior") + return false diff --git a/items/updash.tscn b/items/updash.tscn index e2026f0..05880fd 100644 --- a/items/updash.tscn +++ b/items/updash.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=4 format=3 uid="uid://ewe36lqcjojk"] +[gd_scene load_steps=5 format=3 uid="uid://ewe36lqcjojk"] [ext_resource type="Script" uid="uid://bbwsc2a2hd0ow" path="res://items/updash.gd" id="1_ghbl6"] [ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_ptc3l"] +[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_ktv3s"] [sub_resource type="CircleShape2D" id="CircleShape2D_ghbl6"] @@ -17,3 +18,5 @@ shape = SubResource("CircleShape2D_ghbl6") modulate = Color(1, 0, 1, 1) scale = Vector2(0.45, 0.45) texture = ExtResource("1_ptc3l") + +[node name="EarthAligner" parent="." instance=ExtResource("3_ktv3s")] diff --git a/main.tscn b/main.tscn index d160a2d..46c7d90 100644 --- a/main.tscn +++ b/main.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=9 format=3 uid="uid://cxo6bq26huau7"] +[gd_scene load_steps=8 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"] [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"] @@ -13,7 +12,6 @@ [node name="Earth" parent="." instance=ExtResource("3_lquwl")] unique_name_in_owner = true -script = ExtResource("2_lquwl") [node name="Player" parent="." instance=ExtResource("2_1bvp3")] unique_name_in_owner = true diff --git a/main_menu/main_menu.gd b/main_menu/main_menu.gd new file mode 100644 index 0000000..d3a81eb --- /dev/null +++ b/main_menu/main_menu.gd @@ -0,0 +1,6 @@ +extends Node + + + +func _on_button_start_pressed() -> void: + get_tree().change_scene_to_file("res://main.tscn") diff --git a/main_menu/main_menu.gd.uid b/main_menu/main_menu.gd.uid new file mode 100644 index 0000000..b66e92c --- /dev/null +++ b/main_menu/main_menu.gd.uid @@ -0,0 +1 @@ +uid://bg4qx85we014d diff --git a/main_menu/main_menu.tscn b/main_menu/main_menu.tscn new file mode 100644 index 0000000..e27d15c --- /dev/null +++ b/main_menu/main_menu.tscn @@ -0,0 +1,73 @@ +[gd_scene load_steps=9 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"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d3a7t"] +bg_color = Color(0, 0.7529412, 0, 1) +draw_center = false +corner_radius_top_left = 350 +corner_radius_top_right = 350 +corner_radius_bottom_right = 350 +corner_radius_bottom_left = 350 + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3shxk"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_bws42"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3f7m4"] + +[node name="main" type="Node"] +script = ExtResource("1_bws42") + +[node name="Earth" parent="." instance=ExtResource("1_oa53l")] +unique_name_in_owner = true + +[node name="Camera2D" type="Camera2D" parent="."] +zoom = Vector2(0.12, 0.12) + +[node name="Building Generator" type="Node" parent="."] +script = ExtResource("2_d3a7t") +initial_buildings = 250 +initial_spawn_protection = false + +[node name="Timer" type="Timer" parent="Building Generator"] + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="Control" type="Control" parent="CanvasLayer"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="PanelContainer" type="PanelContainer" parent="CanvasLayer/Control"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -350.0 +offset_top = -350.0 +offset_right = 350.0 +offset_bottom = 350.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("3_3shxk") +theme_override_styles/panel = SubResource("StyleBoxFlat_d3a7t") + +[node name="ButtonStart" type="Button" parent="CanvasLayer/Control/PanelContainer"] +layout_mode = 2 +theme_type_variation = &"FlatButton" +theme_override_styles/pressed = SubResource("StyleBoxEmpty_3shxk") +theme_override_styles/hover = SubResource("StyleBoxEmpty_bws42") +theme_override_styles/focus = SubResource("StyleBoxEmpty_3f7m4") +text = "Play Again" + +[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"] diff --git a/player/Heart Grey.png.import b/player/Heart Grey.png.import index 4683b68..4913ba6 100644 --- a/player/Heart Grey.png.import +++ b/player/Heart Grey.png.import @@ -18,6 +18,8 @@ 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 @@ -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/Heart.png.import b/player/Heart.png.import index 38455ee..dc7cbcd 100644 --- a/player/Heart.png.import +++ b/player/Heart.png.import @@ -18,6 +18,8 @@ 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 @@ -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/Heart_cut Grey.png.import b/player/Heart_cut Grey.png.import index 31c6ef0..be70c9d 100644 --- a/player/Heart_cut Grey.png.import +++ b/player/Heart_cut Grey.png.import @@ -18,6 +18,8 @@ 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 @@ -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/Heart_cut.png.import b/player/Heart_cut.png.import index 1646dfd..fdc244b 100644 --- a/player/Heart_cut.png.import +++ b/player/Heart_cut.png.import @@ -18,6 +18,8 @@ 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 @@ -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/project.godot b/project.godot index c3e6702..82c7244 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://cxo6bq26huau7" +run/main_scene="uid://dpkr8yoobtej6" config/features=PackedStringArray("4.5", "Forward Plus") config/icon="res://icon.svg" diff --git a/world/Background Prototype/Background Prototype Layer 1.png.import b/world/Background Prototype/Background Prototype Layer 1.png.import index 3291c4a..2b3265d 100644 --- a/world/Background Prototype/Background Prototype Layer 1.png.import +++ b/world/Background Prototype/Background Prototype Layer 1.png.import @@ -18,6 +18,8 @@ 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 @@ -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/world/Background Prototype/Background Prototype Layer 2.png.import b/world/Background Prototype/Background Prototype Layer 2.png.import index 7415d89..f18ed3b 100644 --- a/world/Background Prototype/Background Prototype Layer 2.png.import +++ b/world/Background Prototype/Background Prototype Layer 2.png.import @@ -18,6 +18,8 @@ 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 @@ -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/world/Background Prototype/Background Prototype Layer 3.png.import b/world/Background Prototype/Background Prototype Layer 3.png.import index 7399a52..816fbed 100644 --- a/world/Background Prototype/Background Prototype Layer 3.png.import +++ b/world/Background Prototype/Background Prototype Layer 3.png.import @@ -18,6 +18,8 @@ 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 @@ -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/world/Background Prototype/Background Prototype Layer 4.png.import b/world/Background Prototype/Background Prototype Layer 4.png.import index 6ff53ad..b465008 100644 --- a/world/Background Prototype/Background Prototype Layer 4.png.import +++ b/world/Background Prototype/Background Prototype Layer 4.png.import @@ -18,6 +18,8 @@ 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 @@ -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/world/Background prototype.png.import b/world/Background prototype.png.import index c64e0d8..e719aee 100644 --- a/world/Background prototype.png.import +++ b/world/Background prototype.png.import @@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/Background prototype.png-82410769bb8789c49aff 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/world/building_generator.gd b/world/building_generator.gd index 30e9bb9..78813ae 100644 --- a/world/building_generator.gd +++ b/world/building_generator.gd @@ -1,7 +1,8 @@ -extends Node +class_name BuildingGenerator extends Node @onready var grid : Grid = %Earth.get_grid() @export var initial_buildings : int; +@export var initial_spawn_protection = true func random_oppostite_collumn() -> int: var playerpos = %Player.position @@ -19,7 +20,7 @@ func random_collumn() -> int: func _ready(): for i in range(initial_buildings): var collumn = random_collumn() - if 43 <= collumn and collumn <= 49: + if initial_spawn_protection and 43 <= collumn and collumn <= 49: continue var building = randomize_building() grid.add_building_to_collumn(building, collumn) diff --git a/world/earth.tscn b/world/earth.tscn index 98b3618..b0bc2d3 100644 --- a/world/earth.tscn +++ b/world/earth.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=6 format=3 uid="uid://jjoyj1ldafkf"] +[gd_scene load_steps=7 format=3 uid="uid://jjoyj1ldafkf"] +[ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="1_wxnww"] [ext_resource type="Script" uid="uid://b5fhsy1xlreco" path="res://world/draw_circle.gd" id="2_2bhor"] [ext_resource type="Script" uid="uid://m3vyyfk8gnma" path="res://world/grid.gd" id="3_2bhor"] [ext_resource type="PackedScene" uid="uid://djawvtdwp423v" path="res://buildings/building.tscn" id="3_nihcy"] @@ -9,6 +10,7 @@ radius = 3000.0 [node name="Earth" type="Node2D"] +script = ExtResource("1_wxnww") [node name="Ground" type="StaticBody2D" parent="."]