diff --git a/Manager.gd b/Manager.gd index 819f818..d6c1f03 100644 --- a/Manager.gd +++ b/Manager.gd @@ -12,7 +12,7 @@ var current_sector: int = -1 # Timer aktualizacji var update_timer := 0.0 -const UPDATE_INTERVAL := 30.0 +const UPDATE_INTERVAL := 2.0 # Nazwy planet var planet_names = [ @@ -46,6 +46,12 @@ func _initialize_sectors(): var planet_count = randi_range(PLANETS_PER_SECTOR_RANGE.x, PLANETS_PER_SECTOR_RANGE.y) for j in range(planet_count): var size = randi_range(1, 3) + var growth_rate = randf_range(0.1, 1.0) + var texture_planet: String + if growth_rate > 0.7: + texture_planet = "res://assets/planets/p%d.png" % randi_range(1,9) + else: + texture_planet = "res://assets/planets/p%d.png" % randi_range(10,18) var planet = { "name": planet_names[randi() % planet_names.size()], "size": size, @@ -53,10 +59,11 @@ func _initialize_sectors(): "max_population": get_max_population(size), "resources": 0.0, "mining_rate": randf_range(0.1, 1.0), + "growth_rate": growth_rate, "is_colonized": false, "angle": randf() * TAU, - "rotation_speed": randf_range(0.01, 0.04), - "texture_path": "res://assets/planets/p%d.png" % randi_range(1,18) + "rotation_speed": randf_range(0.001, 0.02), + "texture_path": texture_planet, } sectors_data[i]["planets"].append(planet) @@ -67,8 +74,7 @@ func _update_planets(): continue for planet in sector["planets"]: if planet["is_colonized"]: - var growth_rate = 0.1 - var growth = int(max(1, planet["population"] * 0.05 * growth_rate)) + var growth = int(max(1, planet["population"] * 0.05 * planet["growth_rate"])) planet["population"] = min(planet["population"] + growth, planet["max_population"]) planet["resources"] += get_mined_per_cycle(planet) @@ -94,7 +100,7 @@ func get_planet_by_name(name: String) -> Dictionary: return {} # --- Rejestracja nowej planety w danym sektorze --- -func register_planet(sector_index: int, planet_name: String, size: int, mining_rate: float) -> Dictionary: +func register_planet(sector_index: int, planet_name: String, size: int, mining_rate: float, growth_rate: float) -> Dictionary: if sectors_data.size() <= sector_index: sectors_data.resize(sector_index + 1) if sectors_data[sector_index] == null: @@ -107,6 +113,7 @@ func register_planet(sector_index: int, planet_name: String, size: int, mining_r "max_population": get_max_population(size), "resources": 0.0, "mining_rate": mining_rate, + "growth_rate": growth_rate, "is_colonized": false, "angle": randf() * TAU, "rotation_speed": randf_range(0.01, 0.04), diff --git a/assets/planets/p1.png b/assets/planets/p1.png index 41cd97d..f1c7c96 100644 Binary files a/assets/planets/p1.png and b/assets/planets/p1.png differ diff --git a/assets/planets/p1.png.import b/assets/planets/p1.png.import index bb64c76..f5e86b7 100644 --- a/assets/planets/p1.png.import +++ b/assets/planets/p1.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://iprs1u1q2o65" +uid="uid://3b5i4k54e2uw" path="res://.godot/imported/p1.png-c42c3e40721fc6fe437938de585480cd.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p10.png.import b/assets/planets/p10.png.import index 9bbd0fa..7d6328c 100644 --- a/assets/planets/p10.png.import +++ b/assets/planets/p10.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://c5l6s5qx3uto4" +uid="uid://cced5uw5k4if1" path="res://.godot/imported/p10.png-eb46ef667e70ba9df6a4dbacc6709925.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p11.png.import b/assets/planets/p11.png.import index 40a2b93..13c74b6 100644 --- a/assets/planets/p11.png.import +++ b/assets/planets/p11.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bcxsk7rvl2d70" +uid="uid://cdrc5iefs1bn7" path="res://.godot/imported/p11.png-40f511c796ef38e6f2dc1d6ce8c6dcc1.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p12.png.import b/assets/planets/p12.png.import index ff7835d..5e8b4a2 100644 --- a/assets/planets/p12.png.import +++ b/assets/planets/p12.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cebi7c6fdegx7" +uid="uid://bvnmkhnr1f85y" path="res://.godot/imported/p12.png-6346e34cd32a168f5869989e8c974f5a.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p13.png b/assets/planets/p13.png index 9d6dfc7..d98c385 100644 Binary files a/assets/planets/p13.png and b/assets/planets/p13.png differ diff --git a/assets/planets/p13.png.import b/assets/planets/p13.png.import index 76ee4d7..1a37eaf 100644 --- a/assets/planets/p13.png.import +++ b/assets/planets/p13.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cylocrcwlgipn" +uid="uid://bltomtb30wvqd" path="res://.godot/imported/p13.png-4d7623696829ebbf329c027e02f35262.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p14.png b/assets/planets/p14.png index f080112..41cd97d 100644 Binary files a/assets/planets/p14.png and b/assets/planets/p14.png differ diff --git a/assets/planets/p14.png.import b/assets/planets/p14.png.import index 5cee21f..8f5f61e 100644 --- a/assets/planets/p14.png.import +++ b/assets/planets/p14.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dufy40b5dmvlu" +uid="uid://cdcp1nrkpgd0j" path="res://.godot/imported/p14.png-62146a691c78fe48b52ce92ace152029.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p15.png b/assets/planets/p15.png index 4a51251..71ca79a 100644 Binary files a/assets/planets/p15.png and b/assets/planets/p15.png differ diff --git a/assets/planets/p15.png.import b/assets/planets/p15.png.import index ba7d81c..7a29319 100644 --- a/assets/planets/p15.png.import +++ b/assets/planets/p15.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bu67u1r80dfuk" +uid="uid://jqb2acykwsg3" path="res://.godot/imported/p15.png-1d9dc7e436e8054302dc10c56dafe4f6.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p16.png b/assets/planets/p16.png index d441182..4cd931e 100644 Binary files a/assets/planets/p16.png and b/assets/planets/p16.png differ diff --git a/assets/planets/p16.png.import b/assets/planets/p16.png.import index be86c9f..5127ad7 100644 --- a/assets/planets/p16.png.import +++ b/assets/planets/p16.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://df6rlxmmstlyr" +uid="uid://cr2y361nxcybp" path="res://.godot/imported/p16.png-37255585be8a1d1ca338f4b53c5b7bd5.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p17.png b/assets/planets/p17.png index d98c385..adc1d89 100644 Binary files a/assets/planets/p17.png and b/assets/planets/p17.png differ diff --git a/assets/planets/p17.png.import b/assets/planets/p17.png.import index 6044480..70ccfb7 100644 --- a/assets/planets/p17.png.import +++ b/assets/planets/p17.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://b5lvq8xyyai7" +uid="uid://cmish1dvp30tw" path="res://.godot/imported/p17.png-4ec0c958a41097207878a3f69431c3eb.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p18.png b/assets/planets/p18.png index 2fe301d..24dc1d8 100644 Binary files a/assets/planets/p18.png and b/assets/planets/p18.png differ diff --git a/assets/planets/p18.png.import b/assets/planets/p18.png.import index 17fb006..7c53d85 100644 --- a/assets/planets/p18.png.import +++ b/assets/planets/p18.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dm0pkrav001cy" +uid="uid://dw5ngwisrbuym" path="res://.godot/imported/p18.png-ae13acf38f064d372f95b0ce9091814f.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p2.png b/assets/planets/p2.png index f1c7c96..60cc640 100644 Binary files a/assets/planets/p2.png and b/assets/planets/p2.png differ diff --git a/assets/planets/p2.png.import b/assets/planets/p2.png.import index b345995..8cccb55 100644 --- a/assets/planets/p2.png.import +++ b/assets/planets/p2.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cwh4cr1wtt0j4" +uid="uid://bjxy76yh7f0v7" path="res://.godot/imported/p2.png-4ac3d58689143f5132a9012c89a0fbae.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p3.png b/assets/planets/p3.png index 60cc640..e06bcf3 100644 Binary files a/assets/planets/p3.png and b/assets/planets/p3.png differ diff --git a/assets/planets/p3.png.import b/assets/planets/p3.png.import index 4001b97..2fd2823 100644 --- a/assets/planets/p3.png.import +++ b/assets/planets/p3.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cccy266ey70au" +uid="uid://qs7ys0e5aahu" path="res://.godot/imported/p3.png-2d30cfbfeec8bca778c6cd027f163bb1.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p4.png b/assets/planets/p4.png index 71ca79a..c8ba6c8 100644 Binary files a/assets/planets/p4.png and b/assets/planets/p4.png differ diff --git a/assets/planets/p4.png.import b/assets/planets/p4.png.import index 26ae3b2..e1ef325 100644 --- a/assets/planets/p4.png.import +++ b/assets/planets/p4.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://f3ihqty1uuhc" +uid="uid://uv1teou02vsw" path="res://.godot/imported/p4.png-9964b13870cffc622e37a2b6896c7cf1.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p5.png b/assets/planets/p5.png index 4cd931e..9d6dfc7 100644 Binary files a/assets/planets/p5.png and b/assets/planets/p5.png differ diff --git a/assets/planets/p5.png.import b/assets/planets/p5.png.import index 41b0769..3e8584e 100644 --- a/assets/planets/p5.png.import +++ b/assets/planets/p5.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://b2a3dtfu1xogj" +uid="uid://bmu7jwnvu7ob2" path="res://.godot/imported/p5.png-68ab4cc45e4d08d164da276c3ff7b785.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p6.png b/assets/planets/p6.png index adc1d89..f080112 100644 Binary files a/assets/planets/p6.png and b/assets/planets/p6.png differ diff --git a/assets/planets/p6.png.import b/assets/planets/p6.png.import index ecc2c5c..c2cada6 100644 --- a/assets/planets/p6.png.import +++ b/assets/planets/p6.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cdog7yff36w8j" +uid="uid://bps7a80bxe641" path="res://.godot/imported/p6.png-febdf0f58c8ef1fb1ede562a4060468a.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p7.png b/assets/planets/p7.png index e06bcf3..4a51251 100644 Binary files a/assets/planets/p7.png and b/assets/planets/p7.png differ diff --git a/assets/planets/p7.png.import b/assets/planets/p7.png.import index e319d84..2f68dc0 100644 --- a/assets/planets/p7.png.import +++ b/assets/planets/p7.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://p4udfbgtuup4" +uid="uid://bbvf0l0mak6pt" path="res://.godot/imported/p7.png-ddd667980fc6e83e7c1d5387c3063563.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p8.png b/assets/planets/p8.png index c8ba6c8..d441182 100644 Binary files a/assets/planets/p8.png and b/assets/planets/p8.png differ diff --git a/assets/planets/p8.png.import b/assets/planets/p8.png.import index 1b93b39..4f96696 100644 --- a/assets/planets/p8.png.import +++ b/assets/planets/p8.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dpm5yqai3aoje" +uid="uid://hun546m51ov8" path="res://.godot/imported/p8.png-8986b535a1202d2c734eaf2aa2a0e649.ctex" metadata={ "vram_texture": false diff --git a/assets/planets/p9.png b/assets/planets/p9.png index 24dc1d8..2fe301d 100644 Binary files a/assets/planets/p9.png and b/assets/planets/p9.png differ diff --git a/assets/planets/p9.png.import b/assets/planets/p9.png.import index 5192e2f..63effbd 100644 --- a/assets/planets/p9.png.import +++ b/assets/planets/p9.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dua5rbtgoyg4o" +uid="uid://bbej1soqcgn5x" path="res://.godot/imported/p9.png-62dc16a69062b00a41056d31b9f878c5.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s1.png b/assets/stars/s1.png index 6531e15..2438458 100644 Binary files a/assets/stars/s1.png and b/assets/stars/s1.png differ diff --git a/assets/stars/s1.png.import b/assets/stars/s1.png.import index 28dcdae..9222ace 100644 --- a/assets/stars/s1.png.import +++ b/assets/stars/s1.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://xv1yg2d0a6eg" +uid="uid://b4iycl7xcvpkp" path="res://.godot/imported/s1.png-0ce7911f6abb547ddafc2aa0bfb91618.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s10.png b/assets/stars/s10.png deleted file mode 100644 index 0eca92c..0000000 Binary files a/assets/stars/s10.png and /dev/null differ diff --git a/assets/stars/s10.png.import b/assets/stars/s10.png.import deleted file mode 100644 index 6d954d5..0000000 --- a/assets/stars/s10.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dgncjc20205tl" -path="res://.godot/imported/s10.png-cc67c8bdfb2f01dd1220ae8d26a63c59.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s10.png" -dest_files=["res://.godot/imported/s10.png-cc67c8bdfb2f01dd1220ae8d26a63c59.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/stars/s11.png b/assets/stars/s11.png deleted file mode 100644 index c0a271a..0000000 Binary files a/assets/stars/s11.png and /dev/null differ diff --git a/assets/stars/s11.png.import b/assets/stars/s11.png.import deleted file mode 100644 index bacdba9..0000000 --- a/assets/stars/s11.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bkc53eeya0mer" -path="res://.godot/imported/s11.png-c982ef839da56329c386ff36131601c4.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s11.png" -dest_files=["res://.godot/imported/s11.png-c982ef839da56329c386ff36131601c4.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/stars/s12.png b/assets/stars/s12.png deleted file mode 100644 index 945ffd0..0000000 Binary files a/assets/stars/s12.png and /dev/null differ diff --git a/assets/stars/s12.png.import b/assets/stars/s12.png.import deleted file mode 100644 index fd9622e..0000000 --- a/assets/stars/s12.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://14rc372stpsy" -path="res://.godot/imported/s12.png-bd8e77a7e5a38274c947e5197b9fce85.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s12.png" -dest_files=["res://.godot/imported/s12.png-bd8e77a7e5a38274c947e5197b9fce85.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/stars/s13.png b/assets/stars/s13.png deleted file mode 100644 index fad9da4..0000000 Binary files a/assets/stars/s13.png and /dev/null differ diff --git a/assets/stars/s13.png.import b/assets/stars/s13.png.import deleted file mode 100644 index 280c4f5..0000000 --- a/assets/stars/s13.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://behngvl6q7it" -path="res://.godot/imported/s13.png-2db8b8d0a337576c2787a57b2c7c9c1b.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s13.png" -dest_files=["res://.godot/imported/s13.png-2db8b8d0a337576c2787a57b2c7c9c1b.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/stars/s14.png b/assets/stars/s14.png deleted file mode 100644 index fd0ef8a..0000000 Binary files a/assets/stars/s14.png and /dev/null differ diff --git a/assets/stars/s14.png.import b/assets/stars/s14.png.import deleted file mode 100644 index 0467621..0000000 --- a/assets/stars/s14.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://1fvr3c573vvf" -path="res://.godot/imported/s14.png-58fe9c06c00d7717dbf3032d478bcd92.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s14.png" -dest_files=["res://.godot/imported/s14.png-58fe9c06c00d7717dbf3032d478bcd92.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/stars/s15.png b/assets/stars/s15.png deleted file mode 100644 index f944e6c..0000000 Binary files a/assets/stars/s15.png and /dev/null differ diff --git a/assets/stars/s15.png.import b/assets/stars/s15.png.import deleted file mode 100644 index 77c60eb..0000000 --- a/assets/stars/s15.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://ce4q28t6okust" -path="res://.godot/imported/s15.png-655649902a23e7c4eb39a49212031591.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s15.png" -dest_files=["res://.godot/imported/s15.png-655649902a23e7c4eb39a49212031591.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/stars/s16.png b/assets/stars/s16.png deleted file mode 100644 index bf7abde..0000000 Binary files a/assets/stars/s16.png and /dev/null differ diff --git a/assets/stars/s16.png.import b/assets/stars/s16.png.import deleted file mode 100644 index 3502053..0000000 --- a/assets/stars/s16.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bc8pcgdvtl5s5" -path="res://.godot/imported/s16.png-3cc8cde93ade1142bfa15cf5788a31ee.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s16.png" -dest_files=["res://.godot/imported/s16.png-3cc8cde93ade1142bfa15cf5788a31ee.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/stars/s2.png b/assets/stars/s2.png index 2438458..f0583ac 100644 Binary files a/assets/stars/s2.png and b/assets/stars/s2.png differ diff --git a/assets/stars/s2.png.import b/assets/stars/s2.png.import index f7749e1..a28bdde 100644 --- a/assets/stars/s2.png.import +++ b/assets/stars/s2.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dojcaywv7644a" +uid="uid://cy0es1o28j37" path="res://.godot/imported/s2.png-d2771d54a25579b5eda9f285828bb196.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s3.png b/assets/stars/s3.png index f0583ac..83f9730 100644 Binary files a/assets/stars/s3.png and b/assets/stars/s3.png differ diff --git a/assets/stars/s3.png.import b/assets/stars/s3.png.import index 61fc1c5..ef790fb 100644 --- a/assets/stars/s3.png.import +++ b/assets/stars/s3.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://jjvts8q8ike1" +uid="uid://dsfxgajg3jodv" path="res://.godot/imported/s3.png-2199ae6533f1c33882b790c8560ad7da.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s4.png b/assets/stars/s4.png index 9a9d621..00e32f1 100644 Binary files a/assets/stars/s4.png and b/assets/stars/s4.png differ diff --git a/assets/stars/s4.png.import b/assets/stars/s4.png.import index f8dd7fc..a04e34d 100644 --- a/assets/stars/s4.png.import +++ b/assets/stars/s4.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bk0d8sv60md5p" +uid="uid://dgbb5uhvxihjd" path="res://.godot/imported/s4.png-5717c99e544d0cd724c5890ea28c93eb.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s5.png b/assets/stars/s5.png index 1ecc184..902a0d3 100644 Binary files a/assets/stars/s5.png and b/assets/stars/s5.png differ diff --git a/assets/stars/s5.png.import b/assets/stars/s5.png.import index a00433e..d6e5575 100644 --- a/assets/stars/s5.png.import +++ b/assets/stars/s5.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://iux3tem52lsy" +uid="uid://bh1jqxw7ikd6n" path="res://.godot/imported/s5.png-7ca1baeba6ecd3eba7c0cebbcb2a8991.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s6.png b/assets/stars/s6.png index 5b83f35..0eca92c 100644 Binary files a/assets/stars/s6.png and b/assets/stars/s6.png differ diff --git a/assets/stars/s6.png.import b/assets/stars/s6.png.import index f025dfd..a602a0a 100644 --- a/assets/stars/s6.png.import +++ b/assets/stars/s6.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dqcjdfkwhspr2" +uid="uid://rp6gc81hhvpu" path="res://.godot/imported/s6.png-3977e4c129c61357b29ca5586abe9f75.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s7.png b/assets/stars/s7.png index 83f9730..fd0ef8a 100644 Binary files a/assets/stars/s7.png and b/assets/stars/s7.png differ diff --git a/assets/stars/s7.png.import b/assets/stars/s7.png.import index d098b8d..9246e61 100644 --- a/assets/stars/s7.png.import +++ b/assets/stars/s7.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bimlac4bt4yt0" +uid="uid://djmcbja37qn5v" path="res://.godot/imported/s7.png-1d3f0d7a902a12e0a73a7297cd5b7134.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s8.png b/assets/stars/s8.png index 00e32f1..f944e6c 100644 Binary files a/assets/stars/s8.png and b/assets/stars/s8.png differ diff --git a/assets/stars/s8.png.import b/assets/stars/s8.png.import index b869dfb..c46c3c0 100644 --- a/assets/stars/s8.png.import +++ b/assets/stars/s8.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bmy178auqsb8o" +uid="uid://boh4ab2pue4os" path="res://.godot/imported/s8.png-5881c6e0aa1014c097aead63f0e6269f.ctex" metadata={ "vram_texture": false diff --git a/assets/stars/s9.png b/assets/stars/s9.png deleted file mode 100644 index 902a0d3..0000000 Binary files a/assets/stars/s9.png and /dev/null differ diff --git a/assets/stars/s9.png.import b/assets/stars/s9.png.import deleted file mode 100644 index 9752fe5..0000000 --- a/assets/stars/s9.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://ddbt41kkryaqm" -path="res://.godot/imported/s9.png-689776393d2f10b6712c535e76ce83f1.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/stars/s9.png" -dest_files=["res://.godot/imported/s9.png-689776393d2f10b6712c535e76ce83f1.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/scenes/sector.tscn b/scenes/sector.tscn index c83ccfa..0d4c891 100644 --- a/scenes/sector.tscn +++ b/scenes/sector.tscn @@ -10,7 +10,7 @@ position = Vector2(572.00006, 328.5) [node name="PlanetStatPanel" type="Panel" parent="."] offset_right = 284.0 -offset_bottom = 169.0 +offset_bottom = 204.0 [node name="PlanetName" type="Label" parent="PlanetStatPanel"] layout_mode = 0 @@ -42,6 +42,13 @@ offset_top = 118.0 offset_right = 260.0 offset_bottom = 143.0 +[node name="GrowthRate" type="Label" parent="PlanetStatPanel"] +layout_mode = 0 +offset_left = 12.0 +offset_top = 150.0 +offset_right = 262.0 +offset_bottom = 175.0 + [node name="BackButton" type="Button" parent="."] anchors_preset = 6 anchor_left = 1.0 diff --git a/scripts/planet.gd b/scripts/planet.gd index c3cc56d..6d7a475 100644 --- a/scripts/planet.gd +++ b/scripts/planet.gd @@ -4,7 +4,6 @@ class_name Planet @onready var area = $Area2D var sprite: Sprite2D -var colonized_icon: Sprite2D # Dane orbitalne var orbit_center: Vector2 = Vector2.ZERO @@ -15,6 +14,9 @@ var angle: float = 0.0 # Dane planety (przypisywane z Managera) var data: Dictionary = {} +# Rysowanie obwódki kolonizacji +var show_outline := false + signal show_stats(planet) signal hide_stats() @@ -27,14 +29,6 @@ func _ready(): else: angle = randf() * TAU - # Ikona kolonizacji - colonized_icon = Sprite2D.new() - colonized_icon.texture = load("res://assets/icons/col_icon.png") - colonized_icon.centered = true - colonized_icon.visible = false - colonized_icon.scale = Vector2(0.02, 0.02) - add_child(colonized_icon) - if area: area.mouse_entered.connect(_on_mouse_entered) area.mouse_exited.connect(_on_mouse_exited) @@ -51,17 +45,25 @@ func _process(delta): angle += rotation_speed * delta if orbit_center != Vector2.ZERO and orbit_radius > 0.0: position = orbit_center + Vector2(cos(angle), sin(angle)) * orbit_radius - # zapisujemy kąt do danych, żeby pamiętać pozycję if data != null: data["angle"] = angle - # Aktualizacja ikonki kolonizacji - if colonized_icon != null and data != null: - colonized_icon.visible = data["is_colonized"] - var y_offset = 0.0 - if sprite != null and sprite.texture != null: - y_offset = -sprite.texture.get_size().y * 0.13 - colonized_icon.position = Vector2(0, y_offset) + # Obwódka kolonizacji + if data != null: + show_outline = data.get("is_colonized", false) + queue_redraw() # <-- Godot 4 sposób na wymuszenie _draw() + +func _draw(): + if show_outline and sprite != null and sprite.texture != null: + var radius = max(sprite.texture.get_size().x, sprite.texture.get_size().y) * 0.35 * sprite.scale.x + var color = Color(0.717, 0.647, 0.234, 1.0) + var width = 2 # grubość obwódki + var start_angle = 0 + var end_angle = TAU # pełny okrąg + var point_count = 64 # ile punktów w łuku, im więcej tym gładsza obwódka + draw_arc(Vector2.ZERO, radius, start_angle, end_angle, point_count, color, width) + + func set_texture(tex: Texture2D): _ensure_sprite() diff --git a/scripts/sector.gd b/scripts/sector.gd index eb25326..49c6f10 100644 --- a/scripts/sector.gd +++ b/scripts/sector.gd @@ -5,7 +5,8 @@ var PlanetScene = preload("res://scenes/Planet.tscn") @onready var PlanetStatPanel = $PlanetStatPanel @onready var BackButton = $BackButton -const ORBIT_STEP = 120 +var ORBIT_STEP = 150 +const FIRST_ORBIT_STEP = 200 var tracked_planet: Node = null func _ready(): @@ -15,6 +16,11 @@ func _ready(): spawn_planets() BackButton.pressed.connect(_on_back_pressed) +func _process(delta): + if tracked_planet and PlanetStatPanel.visible: + _update_panel() + + func _on_back_pressed(): get_tree().change_scene_to_file("res://scenes/Galaxy.tscn") @@ -44,9 +50,13 @@ func spawn_planets(): planet_node.data = planet_data planet_node.orbit_center = center - planet_node.orbit_radius = planet_data.get("orbit_radius", ORBIT_STEP * (i + 1)) + if i == 0: + planet_node.orbit_radius = planet_data.get("orbit_radius", FIRST_ORBIT_STEP * (i + 1)) + else: + planet_node.orbit_radius = planet_data.get("orbit_radius", ORBIT_STEP * (i + 1)) + planet_node.angle = planet_data.get("angle", randf() * TAU) - planet_node.rotation_speed = planet_data.get("rotation_speed", randf_range(0.01, 0.04)) + planet_node.rotation_speed = planet_data.get("rotation_speed", randf_range(0.00001, 1)) # Tekstura if planet_data.has("texture_path"): @@ -90,7 +100,7 @@ func spawn_star(): Manager.sectors_data[sector_index]["star"] = star_data func random_star_texture_path() -> String: - var id = randi_range(1,16) + var id = randi_range(1,8) return "res://assets/stars/s%d.png" % id # --- Background --- @@ -122,6 +132,7 @@ func _update_panel(): var colonized_text = " (Skolonizowana)" if tracked_planet.data["is_colonized"] else "" PlanetStatPanel.get_node("PlanetName").text = "Name: " + tracked_planet.data["name"] + colonized_text PlanetStatPanel.get_node("PopulationPanel").text = "Populacja: %d / %d" % [tracked_planet.data["population"], tracked_planet.data["max_population"]] - PlanetStatPanel.get_node("MiningRate").text = "Współczynnik wydobycia: %.2f" % tracked_planet.data["mining_rate"] + PlanetStatPanel.get_node("MiningRate").text = "Potencjał surowcowy: %.2f" % tracked_planet.data["mining_rate"] var mined_per_cycle = Manager.get_mined_per_cycle(tracked_planet.data) PlanetStatPanel.get_node("ResourcePlanet").text = "Surowce: %.2f (+%.2f)" % [tracked_planet.data["resources"], mined_per_cycle] + PlanetStatPanel.get_node("GrowthRate").text = "Biosfera: %.2f" % tracked_planet.data["growth_rate"]