diff --git a/Manager.gd b/Manager.gd index 7fb5c2c..19f8cdf 100644 --- a/Manager.gd +++ b/Manager.gd @@ -2,7 +2,7 @@ extends Node # Autoload: Manager # --- KONFIGURACJA --- -@export var SECTOR_COUNT: int = 10 +@export var SECTOR_COUNT: int = 15 @export var PLANETS_PER_SECTOR_RANGE: Vector2 = Vector2(1, 5) const UPDATE_INTERVAL := 2.0 @@ -17,9 +17,28 @@ var update_timer := 0.0 var sector_names = [ "Aetherion", "Altaris", "Andur System", "Artemis Reach", "Astrion", "Azura Prime", "Borealis Expanse", "Caldris Belt", "Canthar System", "Celion Verge", - "Corvax Sector", "Cygnera Rift", "Daedalus Reach", "Darnis Cluster", "Dravon Expanse" + "Corvax Sector", "Cygnera Rift", "Daedalus Reach", "Darnis Cluster", "Dravon Expanse", + "Eclipta Prime", "Erevos System", "Eryndor Belt", "Ethon Reach", "Epsilon Mare", + "Falcoris Rim", "Feron Cluster", "Gaelis System", "Galmar Belt", "Gryphon Reach", + "Halion Expanse", "Helios Verge", "Hespera Sector", "Hyden Reach", "Icarion System", + "Illun Belt", "Istris Cluster", "Jorath System", "Kaelor Expanse", "Kassian Reach", + "Koralis Rim", "Krynn Sector", "Lunaris Reach", "Lysara System", "Maelor Verge", + "Magnor Belt", "Mareth Cluster", "Meridian Expanse", "Morthal System", "Myrris Reach", + "Nadir Verge", "Naos Sector", "Nerath Cluster", "Norian Belt", "Nova Thal", + "Oblivis Reach", "Odessa Expanse", "Orionis Verge", "Orryx System", "Pallas Belt", + "Parallax Rim", "Perion Sector", "Pharos System", "Phoenix Reach", "Primis Expanse", + "Pyra Cluster", "Quaron Belt", "Quiris System", "Ragnar Verge", "Rathor Expanse", + "Ravenna Sector", "Regalis System", "Remora Reach", "Rydan Belt", "Saren Cluster", + "Selena Verge", "Seraphis System", "Shadow Rift", "Silvar Reach", "Solara Expanse", + "Starnis Belt", "Syrion Cluster", "Talion System", "Tarsis Verge", "Tauren Expanse", + "Tenebris Rim", "Thalassa Reach", "Tharon Belt", "Tirion Sector", "Tritonis Expanse", + "Umbra Verge", "Valis Reach", "Varon Cluster", "Velora System", "Verrin Belt", + "Veyra Expanse", "Viridis Rim", "Volnar Sector", "Vortex Reach", "Vulcaris System", + "Wraith Expanse", "Xandor Cluster", "Xerion Verge", "Ymir Belt", "Zephyra System", + "Zerath Expanse", "Zyra Prime", "Zyneth Reach", "Zorath System", "Zyphon Rim" ] + var planet_names = [ "Arcturus","Betelgeuse","Canopus","Deneb","Elnath", "Fomalhaut","Gacrux","Hadar","Izar","Jabbah", @@ -68,7 +87,7 @@ func _initialize_sectors(): # Losowa gwiazda var star_texture = _random_star_texture() - var star_scale = randf_range(0.05, 0.08) + var star_scale = randf_range(0.03, 0.03) # Utworzenie sektora sectors_data[i] = { @@ -160,7 +179,7 @@ func register_planet(sector_index: int, planet_name: String, size: int, mining_r "growth_rate": growth_rate, "is_colonized": false, "angle": randf() * TAU, - "rotation_speed": randf_range(0.01, 0.04), + "rotation_speed": randf_range(0.01, 0.03), "texture_path": "res://assets/planets/p%d.png" % randi_range(1,18) } sectors_data[sector_index]["planets"].append(planet) @@ -170,3 +189,21 @@ func register_planet(sector_index: int, planet_name: String, size: int, mining_r func _random_star_texture() -> String: var id = randi_range(1, 8) return "res://assets/stars/s%d.png" % id + +func generate_non_overlapping_position(existing_positions: Array, min_distance: float, screen_size: Vector2) -> Vector2: + var pos: Vector2 + var attempts = 0 + while true: + pos = Vector2( + randf_range(100, screen_size.x - 200), + randf_range(100, screen_size.y - 200) + ) + var overlap = false + for other in existing_positions: + if pos.distance_to(other) < min_distance: + overlap = true + break + attempts += 1 + if not overlap or attempts > 100: + break + return pos diff --git a/assets/background/galaxy_background.jpg b/assets/background/galaxy_background.jpg index 82f8877..b356761 100644 Binary files a/assets/background/galaxy_background.jpg and b/assets/background/galaxy_background.jpg differ diff --git a/assets/fonts/font.ttf b/assets/fonts/font.ttf new file mode 100644 index 0000000..e89b0fe Binary files /dev/null and b/assets/fonts/font.ttf differ diff --git a/assets/fonts/font.ttf.import b/assets/fonts/font.ttf.import new file mode 100644 index 0000000..324bd6b --- /dev/null +++ b/assets/fonts/font.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bwvx53j60bvtd" +path="res://.godot/imported/font.ttf-39b250d5b3aa0fc62f2ec61dd6a2edd2.fontdata" + +[deps] + +source_file="res://assets/fonts/font.ttf" +dest_files=["res://.godot/imported/font.ttf-39b250d5b3aa0fc62f2ec61dd6a2edd2.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/font2.ttf b/assets/fonts/font2.ttf new file mode 100644 index 0000000..03979d1 Binary files /dev/null and b/assets/fonts/font2.ttf differ diff --git a/assets/fonts/font2.ttf.import b/assets/fonts/font2.ttf.import new file mode 100644 index 0000000..3373930 --- /dev/null +++ b/assets/fonts/font2.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://drp85tpfncq5m" +path="res://.godot/imported/font2.ttf-59e4c6b4a5306e7f84a55bb565749f73.fontdata" + +[deps] + +source_file="res://assets/fonts/font2.ttf" +dest_files=["res://.godot/imported/font2.ttf-59e4c6b4a5306e7f84a55bb565749f73.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/icons/buttons/button_blue.png b/assets/icons/buttons/button_blue.png new file mode 100644 index 0000000..15992b1 Binary files /dev/null and b/assets/icons/buttons/button_blue.png differ diff --git a/assets/icons/buttons/button_blue.png.import b/assets/icons/buttons/button_blue.png.import new file mode 100644 index 0000000..79dd7f2 --- /dev/null +++ b/assets/icons/buttons/button_blue.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://da6hb1mill5yn" +path="res://.godot/imported/button_blue.png-9e61fe31e1f47b3787787390ec1a37de.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/buttons/button_blue.png" +dest_files=["res://.godot/imported/button_blue.png-9e61fe31e1f47b3787787390ec1a37de.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/buttons/button_red.png b/assets/icons/buttons/button_red.png new file mode 100644 index 0000000..33efbce Binary files /dev/null and b/assets/icons/buttons/button_red.png differ diff --git a/assets/icons/buttons/button_red.png.import b/assets/icons/buttons/button_red.png.import new file mode 100644 index 0000000..9ce8786 --- /dev/null +++ b/assets/icons/buttons/button_red.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://t2pwtja7yfa4" +path="res://.godot/imported/button_red.png-7f6ba3252f9eb4ae6f8c6089f85e1b8c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/buttons/button_red.png" +dest_files=["res://.godot/imported/button_red.png-7f6ba3252f9eb4ae6f8c6089f85e1b8c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/icons/logo_game.png b/assets/icons/logo_game.png new file mode 100644 index 0000000..658fd66 Binary files /dev/null and b/assets/icons/logo_game.png differ diff --git a/assets/icons/logo_game.png.import b/assets/icons/logo_game.png.import new file mode 100644 index 0000000..5716304 --- /dev/null +++ b/assets/icons/logo_game.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dssoa5bxs2h4r" +path="res://.godot/imported/logo_game.png-a367ce6ee12a13d3e8f1ca4c77514783.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/logo_game.png" +dest_files=["res://.godot/imported/logo_game.png-a367ce6ee12a13d3e8f1ca4c77514783.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/project.godot b/project.godot index 8b42399..cdf2aa9 100644 --- a/project.godot +++ b/project.godot @@ -22,4 +22,7 @@ MusicManager="*res://music_manager.gd" [display] -window/size/mode=2 +window/size/viewport_width=2560 +window/size/viewport_height=1440 +window/size/resizable=false +window/stretch/mode="viewport" diff --git a/scenes/menu.tscn b/scenes/menu.tscn index a7b0fe5..993aab8 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -1,53 +1,13 @@ -[gd_scene load_steps=8 format=3 uid="uid://sxae8i12io4y"] +[gd_scene load_steps=9 format=3 uid="uid://sxae8i12io4y"] -[ext_resource type="Script" path="res://scripts/menu.gd" id="1_vjb58"] +[ext_resource type="Script" uid="uid://ol6efor868gk" path="res://scripts/menu.gd" id="1_vjb58"] [ext_resource type="Texture2D" uid="uid://xuw4ki75j3fy" path="res://assets/background/menubg.png" id="1_yqeox"] [ext_resource type="AudioStream" uid="uid://ditln0kq3u3dm" path="res://assets/sounds/music/menu_music.mp3" id="3_con2f"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yqeox"] -bg_color = Color(0.1567365, 0.410904, 0.5666233, 1) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color(0, 0, 0, 1) -corner_radius_top_left = 12 -corner_radius_top_right = 12 -corner_radius_bottom_right = 12 -corner_radius_bottom_left = 12 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vjb58"] -bg_color = Color(0.5891781, 0.78593767, 0.93167466, 1) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -corner_radius_top_left = 12 -corner_radius_top_right = 12 -corner_radius_bottom_right = 12 -corner_radius_bottom_left = 12 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_con2f"] -bg_color = Color(0.09019608, 0.15294118, 0.28235295, 1) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -corner_radius_top_left = 12 -corner_radius_top_right = 12 -corner_radius_bottom_right = 12 -corner_radius_bottom_left = 12 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mhnvy"] -bg_color = Color(0.09026273, 0.15419397, 0.28203714, 1) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -corner_radius_top_left = 12 -corner_radius_top_right = 12 -corner_radius_bottom_right = 12 -corner_radius_bottom_left = 12 +[ext_resource type="PackedScene" uid="uid://gvx2ukt1why" path="res://scenes/option_popup.tscn" id="3_mhnvy"] +[ext_resource type="Texture2D" uid="uid://c5qd42wn52jx7" path="res://assets/icons/buttons/button_blue.png" id="3_v86rl"] +[ext_resource type="Texture2D" uid="uid://djqo5u4rtnaaq" path="res://assets/icons/buttons/button_red.png" id="4_13sgg"] +[ext_resource type="Texture2D" uid="uid://dssoa5bxs2h4r" path="res://assets/icons/logo_game.png" id="5_4ytvr"] +[ext_resource type="FontFile" uid="uid://bwvx53j60bvtd" path="res://assets/fonts/font.ttf" id="5_13sgg"] [node name="MainMenu" type="Control"] layout_mode = 3 @@ -75,31 +35,93 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -125.0 -offset_top = -37.0 -offset_right = 117.0 -offset_bottom = 167.0 +offset_left = -197.0 +offset_top = -119.0 +offset_right = 569.0 +offset_bottom = 842.0 grow_horizontal = 2 grow_vertical = 2 +scale = Vector2(0.5, 0.5) theme_override_constants/separation = 20 -[node name="start" type="Button" parent="VBoxContainer"] +[node name="start" type="TextureButton" parent="VBoxContainer"] layout_mode = 2 -theme_override_font_sizes/font_size = 31 -theme_override_styles/normal = SubResource("StyleBoxFlat_yqeox") -theme_override_styles/pressed = SubResource("StyleBoxFlat_vjb58") -theme_override_styles/hover = SubResource("StyleBoxFlat_con2f") -text = "START" +texture_normal = ExtResource("3_v86rl") +texture_hover = ExtResource("4_13sgg") -[node name="exit" type="Button" parent="VBoxContainer"] +[node name="Label" type="Label" parent="VBoxContainer/start"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -345.0 +offset_top = -121.5 +offset_right = 345.0 +offset_bottom = 122.5 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_colors/font_color = Color(0.056970224, 0.008738811, 0.00917984, 1) +theme_override_colors/font_shadow_color = Color(0.7570387, 0.75415635, 0.7885611, 0) +theme_override_colors/font_outline_color = Color(0.9581385, 0.7134137, 0.07074302, 1) +theme_override_constants/outline_size = 16 +theme_override_fonts/font = ExtResource("5_13sgg") +theme_override_font_sizes/font_size = 110 +text = "START" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="option" type="TextureButton" parent="VBoxContainer"] layout_mode = 2 -theme_override_font_sizes/font_size = 31 -theme_override_styles/normal = SubResource("StyleBoxFlat_yqeox") -theme_override_styles/pressed = SubResource("StyleBoxFlat_vjb58") -theme_override_styles/hover = SubResource("StyleBoxFlat_mhnvy") -text = "WYJŚCIE" +texture_normal = ExtResource("3_v86rl") +texture_hover = ExtResource("4_13sgg") + +[node name="Label" type="Label" parent="VBoxContainer/option"] +layout_mode = 0 +offset_left = 34.0 +offset_top = 33.0 +offset_right = 730.0 +offset_bottom = 277.0 +theme_override_colors/font_color = Color(0.056970224, 0.008738811, 0.00917984, 1) +theme_override_colors/font_shadow_color = Color(0.7570387, 0.75415635, 0.7885611, 0) +theme_override_colors/font_outline_color = Color(0.9581385, 0.7134137, 0.07074302, 1) +theme_override_constants/outline_size = 16 +theme_override_fonts/font = ExtResource("5_13sgg") +theme_override_font_sizes/font_size = 110 +text = "OPCJE" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="exit" type="TextureButton" parent="VBoxContainer"] +layout_mode = 2 +texture_normal = ExtResource("3_v86rl") +texture_hover = ExtResource("4_13sgg") + +[node name="Label" type="Label" parent="VBoxContainer/exit"] +layout_mode = 0 +offset_left = 40.0 +offset_top = 32.0 +offset_right = 736.0 +offset_bottom = 276.0 +theme_override_colors/font_color = Color(0.056970224, 0.008738811, 0.00917984, 1) +theme_override_colors/font_shadow_color = Color(0.7570387, 0.75415635, 0.7885611, 0) +theme_override_colors/font_outline_color = Color(0.9581385, 0.7134137, 0.07074302, 1) +theme_override_constants/outline_size = 16 +theme_override_fonts/font = ExtResource("5_13sgg") +theme_override_font_sizes/font_size = 110 +text = "ZAMKNIJ" +horizontal_alignment = 1 +vertical_alignment = 1 [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] stream = ExtResource("3_con2f") volume_db = 7.068 autoplay = true + +[node name="OptionPopup" parent="." instance=ExtResource("3_mhnvy")] + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(1277, 420.99997) +scale = Vector2(0.45898455, 0.43310553) +texture = ExtResource("5_4ytvr") diff --git a/scenes/option_popup.tscn b/scenes/option_popup.tscn new file mode 100644 index 0000000..ec73e69 --- /dev/null +++ b/scenes/option_popup.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=4 format=3 uid="uid://gvx2ukt1why"] + +[ext_resource type="Script" uid="uid://dorxwjjqlr2fx" path="res://scripts/option_popup.gd" id="1_88e14"] +[ext_resource type="Texture2D" uid="uid://dsfxgajg3jodv" path="res://assets/stars/s3.png" id="2_orwg4"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_88e14"] +bg_color = Color(0.046670742, 0.07739959, 0.26242417, 0.92156863) +draw_center = false +corner_radius_top_left = 12 +corner_radius_top_right = 12 +corner_radius_bottom_right = 12 +corner_radius_bottom_left = 12 + +[node name="OptionsPopup" type="PopupPanel"] +transparent_bg = false +oversampling_override = 1.0 +title = "Opcje" +size = Vector2i(400, 300) +visible = true +theme_override_styles/panel = SubResource("StyleBoxFlat_88e14") +script = ExtResource("1_88e14") + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(197.99998, 153.49998) +scale = Vector2(2.3199997, 2.0233333) +texture = ExtResource("2_orwg4") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +offset_right = 400.0 +offset_bottom = 300.0 + +[node name="Label" type="Label" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 20 +text = "OPCJE" +horizontal_alignment = 1 + +[node name="Label2" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "Rozdzielczość" +horizontal_alignment = 1 + +[node name="Resolution" type="OptionButton" parent="VBoxContainer"] +layout_mode = 2 + +[node name="CheckBox" type="CheckBox" parent="VBoxContainer"] +layout_mode = 2 +text = "Pełny ekran" + +[node name="Apply" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Zastosuj +" + +[node name="Exit" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Zamknij" diff --git a/scenes/options.tscn b/scenes/options.tscn new file mode 100644 index 0000000..24388b3 --- /dev/null +++ b/scenes/options.tscn @@ -0,0 +1,28 @@ +[gd_scene format=3 uid="uid://t6cx3pwnhodp"] + +[node name="Control" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -2067.0 +offset_bottom = -652.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="2560" type="Button" parent="."] +layout_mode = 0 +offset_left = 117.0 +offset_top = 49.0 +offset_right = 207.0 +offset_bottom = 80.0 +text = "2560x1440" + +[node name="1920" type="Button" parent="."] +layout_mode = 0 +offset_left = 115.0 +offset_top = 3.0 +offset_right = 205.0 +offset_bottom = 34.0 +text = "1920x1080 +" diff --git a/scenes/sector.tscn b/scenes/sector.tscn index cc1d6c8..75333e9 100644 --- a/scenes/sector.tscn +++ b/scenes/sector.tscn @@ -11,6 +11,7 @@ script = ExtResource("1_l8itw") position = Vector2(572.00006, 328.5) [node name="PlanetStatPanel" type="Panel" parent="."] +visible = false offset_right = 320.0 offset_bottom = 204.0 diff --git a/scripts/galaxy.gd b/scripts/galaxy.gd index 9deef05..a91072e 100644 --- a/scripts/galaxy.gd +++ b/scripts/galaxy.gd @@ -29,12 +29,18 @@ func _create_sector_buttons(): # Podpis sektora var sector_label = Label.new() sector_label.text = sector_info["name"] - sector_label.modulate = Color(0.386, 0.577, 0.778, 1.0) # czerwony + sector_label.modulate = Color(0.979, 0.808, 0.764, 1.0) # czerwony #sector_label.scale = Vector2(0.5, 0.5) # ignoruje skalę gwiazdy - sector_label.add_theme_font_size_override("font_size", 300) # malutki podpis + sector_label.add_theme_font_size_override("font_size", 600) # malutki podpis sector_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - sector_label.position = Vector2(0, -450) + sector_label.position = Vector2(-1002, -650) + + # 🔹 Ustawienie czcionki: + # ✅ Poprawne ładowanie czcionki + var font = load("res://assets/fonts/font2.ttf") + sector_label.add_theme_font_override("font", font) + button.add_child(sector_label) var index = i @@ -59,6 +65,7 @@ func _init_background(): var screen_size = get_viewport_rect().size var tex_size = background.texture.get_size() var scale_factor = max(screen_size.x / tex_size.x, screen_size.y / tex_size.y) - background.scale = Vector2(scale_factor, scale_factor) + background.scale = screen_size / tex_size + add_child(background) background.z_index = -10 diff --git a/scripts/menu.gd b/scripts/menu.gd index 64624b5..50d123e 100644 --- a/scripts/menu.gd +++ b/scripts/menu.gd @@ -1,8 +1,15 @@ extends Control - +@onready var option_popup = $OptionPopup func _ready(): $VBoxContainer/start.connect("pressed", Callable(self, "_on_start_pressed")) $VBoxContainer/exit.connect("pressed", Callable(self, "_on_exit_pressed")) + $VBoxContainer/option.connect("pressed", Callable(self, "_on_Opcje_pressed")) + + + +func _on_Opcje_pressed(): + option_popup.popup_centered() + func _on_start_pressed(): get_tree().change_scene_to_file("res://scenes/Galaxy.tscn") diff --git a/scripts/option_popup.gd b/scripts/option_popup.gd new file mode 100644 index 0000000..f1da690 --- /dev/null +++ b/scripts/option_popup.gd @@ -0,0 +1,38 @@ +extends PopupPanel + +@onready var fullscreen_checkbox = $VBoxContainer/CheckBox +@onready var volume_slider = $VBoxContainer/HSlider +@onready var resolution_dropdown = $VBoxContainer/Resolution + +var resolutions = [ + Vector2i(1920, 1080), + Vector2i(2560, 1440) +] + +func _ready(): + fullscreen_checkbox.button_pressed = DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN + $VBoxContainer/Exit.pressed.connect(_on_Zamknij_pressed) + $VBoxContainer/Apply.pressed.connect(_on_Zastosuj_pressed) + + # wypełnienie listy rozdzielczości + + for res in resolutions: + + var label = "%d x %d" % [res.x, res.y] + resolution_dropdown.add_item(label) + +func _on_Zastosuj_pressed(): + if fullscreen_checkbox.button_pressed: + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) + else: + DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) + + # Tu możesz np. zapisać ustawienia do pliku + hide() + +func _on_Zamknij_pressed(): + hide() + + +func _on_exit_pressed() -> void: + pass # Replace with function body. diff --git a/scripts/option_popup.gd.uid b/scripts/option_popup.gd.uid new file mode 100644 index 0000000..c9e01fa --- /dev/null +++ b/scripts/option_popup.gd.uid @@ -0,0 +1 @@ +uid://dorxwjjqlr2fx diff --git a/scripts/sector.gd b/scripts/sector.gd index 4fec407..6973d55 100644 --- a/scripts/sector.gd +++ b/scripts/sector.gd @@ -5,7 +5,7 @@ var PlanetScene = preload("res://scenes/Planet.tscn") @onready var PlanetStatPanel = $PlanetStatPanel @onready var BackButton: TextureButton = $BackButton -var ORBIT_STEP = 120 +var ORBIT_STEP = 130 const FIRST_ORBIT_STEP = 160 var tracked_planet: Node = null