Dodanie growth rate
usuniecie flagi dodanie obramówki
19
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),
|
||||
|
||||
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 79 KiB |
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 89 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 76 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 93 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 76 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 78 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 88 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 81 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 90 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 83 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 84 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 80 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 89 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 93 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 81 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 639 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 824 KiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 1.2 MiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 1.2 MiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 1.3 MiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 550 KiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 1.1 MiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 975 KiB |
@ -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
|
||||
|
Before Width: | Height: | Size: 639 KiB After Width: | Height: | Size: 1.5 MiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 707 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 529 KiB After Width: | Height: | Size: 736 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 694 KiB After Width: | Height: | Size: 788 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 824 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 707 KiB After Width: | Height: | Size: 550 KiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 736 KiB After Width: | Height: | Size: 1.1 MiB |
@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 788 KiB |
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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"]
|
||||
|
||||