diff --git a/Game.tscn b/Game.tscn index e9423c1..7d707de 100644 --- a/Game.tscn +++ b/Game.tscn @@ -6,6 +6,7 @@ [ext_resource type="PackedScene" uid="uid://qpdlnll5pihe" path="res://objects/Planter.tscn" id="3_qx0o7"] [node name="Game" type="Node2D"] +y_sort_enabled = true [node name="Map" parent="." instance=ExtResource("1_nnb57")] diff --git a/Menu.tscn b/Menu.tscn index a25cb29..9a6e8ad 100644 --- a/Menu.tscn +++ b/Menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://b56357feudy7x"] +[gd_scene load_steps=18 format=3 uid="uid://b56357feudy7x"] [ext_resource type="Script" path="res://scripts/gui/menu.gd" id="1_88exu"] [ext_resource type="Texture2D" uid="uid://bkwi6yurko7gm" path="res://assets/texture/sol_gamejam_fleurs.png" id="1_t32ec"] @@ -9,6 +9,7 @@ [ext_resource type="Texture2D" uid="uid://b8rmpitmxeobx" path="res://assets/plants/herbe8.png" id="7_xxlvc"] [ext_resource type="Theme" uid="uid://dnebunkx13tbr" path="res://assets/gui/Text.tres" id="8_h7a3q"] [ext_resource type="SpriteFrames" uid="uid://8ewbadpftqoh" path="res://assets/sprites/robot/walk/Robot.tres" id="9_ri4qo"] +[ext_resource type="Texture2D" uid="uid://cccgom1hslks" path="res://assets/Seed_title.png" id="10_67mnr"] [sub_resource type="Gradient" id="Gradient_ytbij"] offsets = PackedFloat32Array(0, 0.446746, 1) @@ -236,6 +237,11 @@ text = "Seeding the Wasteland" label_settings = SubResource("LabelSettings_0qv27") +[node name="SeedTitle" type="Sprite2D" parent="MarginContainer/VBoxContainer"] +position = Vector2(93, 32) +scale = Vector2(0.0631215, 0.0631215) +texture = ExtResource("10_67mnr") + [node name="ClickToPlay" type="Label" parent="MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_horizontal = 0 diff --git a/assets/Seed_title.png b/assets/Seed_title.png new file mode 100644 index 0000000..e6a8f5a Binary files /dev/null and b/assets/Seed_title.png differ diff --git a/assets/Seed_title.png.import b/assets/Seed_title.png.import new file mode 100644 index 0000000..d8d3e17 --- /dev/null +++ b/assets/Seed_title.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cccgom1hslks" +path="res://.godot/imported/Seed_title.png-4efb43a44ba92dc6d589a9df432822f3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Seed_title.png" +dest_files=["res://.godot/imported/Seed_title.png-4efb43a44ba92dc6d589a9df432822f3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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/plants/frames_arbre_sprites.png b/assets/plants/frames_arbre_sprites.png new file mode 100644 index 0000000..9399107 Binary files /dev/null and b/assets/plants/frames_arbre_sprites.png differ diff --git a/assets/plants/frames_arbre_sprites.png.import b/assets/plants/frames_arbre_sprites.png.import new file mode 100644 index 0000000..1189bb1 --- /dev/null +++ b/assets/plants/frames_arbre_sprites.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c20w02hmmlrnu" +path="res://.godot/imported/frames_arbre_sprites.png-19591f1a2e9e68a1506e2904e0f6736e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/plants/frames_arbre_sprites.png" +dest_files=["res://.godot/imported/frames_arbre_sprites.png-19591f1a2e9e68a1506e2904e0f6736e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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/objects/Animal.tscn b/objects/Animal.tscn index 8c21b10..bdc6634 100644 --- a/objects/Animal.tscn +++ b/objects/Animal.tscn @@ -5,7 +5,7 @@ [ext_resource type="Theme" uid="uid://dnebunkx13tbr" path="res://assets/gui/Text.tres" id="3_lefgl"] [sub_resource type="CircleShape2D" id="CircleShape2D_5dvar"] -radius = 599.083 +radius = 557.022 [sub_resource type="Animation" id="Animation_qi2vx"] resource_name = "Closed" @@ -308,8 +308,9 @@ fill_to = Vector2(0.538462, 0.175214) font_size = 21 [node name="Animal" type="Node2D"] +y_sort_enabled = true script = ExtResource("1_bjim0") -n_plant_needed = 8 +n_plant_needed = 15 [node name="Sprite2D" type="Sprite2D" parent="."] modulate = Color(0.529067, 0.529067, 0.529067, 1) @@ -351,6 +352,7 @@ scale = Vector2(0.964966, 0.964966) texture = SubResource("GradientTexture2D_7pg56") [node name="PlantsCount" type="Label" parent="."] +z_index = 1 offset_left = -15.0 offset_top = -148.0 offset_right = 45.0 diff --git a/objects/Planter.tscn b/objects/Planter.tscn index d83b13e..ea3c54a 100644 --- a/objects/Planter.tscn +++ b/objects/Planter.tscn @@ -31,7 +31,7 @@ one_shot = true position = Vector2(1439, 1360) [node name="RobotSeed" type="Sprite2D" parent="Robot"] -position = Vector2(0, 63) -scale = Vector2(0.5, 0.5) +position = Vector2(0, 10) +scale = Vector2(0.3, 0.3) [connection signal="Planted" from="Robot" to="." method="_on_robot_planted"] diff --git a/objects/Robot.tscn b/objects/Robot.tscn index 6961ce8..f2e20a2 100644 --- a/objects/Robot.tscn +++ b/objects/Robot.tscn @@ -13,11 +13,13 @@ script = ExtResource("1_4eix8") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +position = Vector2(0, -63) scale = Vector2(0.0890625, 0.0890625) sprite_frames = ExtResource("2_k06te") animation = &"Walk" autoplay = "Walk" frame_progress = 0.127315 +offset = Vector2(0, -33.765) [node name="Planting" type="Timer" parent="."] one_shot = true diff --git a/objects/plant.tscn b/objects/plant.tscn index 6118af2..a06eda6 100644 --- a/objects/plant.tscn +++ b/objects/plant.tscn @@ -75,6 +75,7 @@ one_shot = true scale = Vector2(0.2, 0.2) sprite_frames = SubResource("SpriteFrames_667un") animation = &"SEED" +speed_scale = 0.0 offset = Vector2(0, -250) [node name="Area2D" type="Area2D" parent="."] diff --git a/objects/plant_types/Bonaluria.tres b/objects/plant_types/Bonaluria.tres index fec3c84..fae6ccc 100644 --- a/objects/plant_types/Bonaluria.tres +++ b/objects/plant_types/Bonaluria.tres @@ -1,15 +1,136 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://cfbdjq14ouwra"] +[gd_resource type="Resource" script_class="PlantType" load_steps=39 format=3 uid="uid://cfbdjq14ouwra"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_208yf"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_wwtfx"] [ext_resource type="Texture2D" uid="uid://di74g50h3oruf" path="res://assets/plants/plantes mortes/arbre_mort.png" id="3_8jirk"] [ext_resource type="Texture2D" uid="uid://dwm660gppiset" path="res://assets/plants/abre2.png" id="4_ore5j"] [ext_resource type="Texture2D" uid="uid://c5felbfti153f" path="res://assets/plants/arbre_phase1.png" id="5_aukq7"] +[ext_resource type="Texture2D" uid="uid://c20w02hmmlrnu" path="res://assets/plants/frames_arbre_sprites.png" id="5_udqsl"] [sub_resource type="AtlasTexture" id="AtlasTexture_wgugp"] atlas = ExtResource("2_wwtfx") region = Rect2(0, 540, 270, 270) +[sub_resource type="AtlasTexture" id="AtlasTexture_cjm6v"] +atlas = ExtResource("5_udqsl") +region = Rect2(0, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t5gw7"] +atlas = ExtResource("5_udqsl") +region = Rect2(1000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mspmq"] +atlas = ExtResource("5_udqsl") +region = Rect2(2000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_82el2"] +atlas = ExtResource("5_udqsl") +region = Rect2(3000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3ymjj"] +atlas = ExtResource("5_udqsl") +region = Rect2(4000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dmppb"] +atlas = ExtResource("5_udqsl") +region = Rect2(5000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o46cw"] +atlas = ExtResource("5_udqsl") +region = Rect2(6000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i6ohj"] +atlas = ExtResource("5_udqsl") +region = Rect2(7000, 0, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hv1dq"] +atlas = ExtResource("5_udqsl") +region = Rect2(0, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gdio8"] +atlas = ExtResource("5_udqsl") +region = Rect2(1000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hmlqp"] +atlas = ExtResource("5_udqsl") +region = Rect2(2000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_obt0y"] +atlas = ExtResource("5_udqsl") +region = Rect2(3000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ch6bx"] +atlas = ExtResource("5_udqsl") +region = Rect2(4000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ekdvb"] +atlas = ExtResource("5_udqsl") +region = Rect2(5000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3rpko"] +atlas = ExtResource("5_udqsl") +region = Rect2(6000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4xhw5"] +atlas = ExtResource("5_udqsl") +region = Rect2(7000, 605, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bxl2x"] +atlas = ExtResource("5_udqsl") +region = Rect2(0, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_keg52"] +atlas = ExtResource("5_udqsl") +region = Rect2(1000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tuv5m"] +atlas = ExtResource("5_udqsl") +region = Rect2(2000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_safva"] +atlas = ExtResource("5_udqsl") +region = Rect2(3000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hs5wt"] +atlas = ExtResource("5_udqsl") +region = Rect2(4000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wpud5"] +atlas = ExtResource("5_udqsl") +region = Rect2(5000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2wqx7"] +atlas = ExtResource("5_udqsl") +region = Rect2(6000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4uv5p"] +atlas = ExtResource("5_udqsl") +region = Rect2(7000, 1210, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5vpdr"] +atlas = ExtResource("5_udqsl") +region = Rect2(0, 1815, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_v5wkb"] +atlas = ExtResource("5_udqsl") +region = Rect2(1000, 1815, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y11b3"] +atlas = ExtResource("5_udqsl") +region = Rect2(2000, 1815, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_oipy7"] +atlas = ExtResource("5_udqsl") +region = Rect2(3000, 1815, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_c3gyp"] +atlas = ExtResource("5_udqsl") +region = Rect2(4000, 1815, 1000, 605) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ssj6n"] +atlas = ExtResource("5_udqsl") +region = Rect2(5000, 1815, 1000, 605) + [sub_resource type="SpriteFrames" id="SpriteFrames_teefd"] animations = [{ "frames": [{ @@ -23,6 +144,96 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_ore5j") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cjm6v") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t5gw7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mspmq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_82el2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3ymjj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dmppb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o46cw") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i6ohj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hv1dq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gdio8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hmlqp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_obt0y") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ch6bx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ekdvb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3rpko") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4xhw5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bxl2x") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_keg52") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tuv5m") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_safva") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hs5wt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wpud5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2wqx7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4uv5p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5vpdr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_v5wkb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y11b3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_oipy7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_c3gyp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ssj6n") }], "loop": true, "name": &"GROWN", @@ -42,8 +253,8 @@ script = ExtResource("1_208yf") type = "Bonaluria" seed_sprite = SubResource("AtlasTexture_wgugp") sprite_frames = SubResource("SpriteFrames_teefd") -growing_time = 60.0 -offspring_per_lifetime = 0 +growing_time = 30.0 +offspring_per_lifetime = 1 dying_time = 240.0 dead_time = 120.0 water_need = [-1, 10] @@ -55,3 +266,4 @@ presence_prod = 4 dead_water_prod = 3 dead_fertility_prod = 2 distance_prod = 600 +distance_prod_falloff = 300 diff --git a/objects/plant_types/Ekoth.tres b/objects/plant_types/Ekoth.tres index 2bf5069..8003ee5 100644 --- a/objects/plant_types/Ekoth.tres +++ b/objects/plant_types/Ekoth.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://b4bdxpunvgc2j"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://b4bdxpunvgc2j"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_duqty"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_lk0j2"] [ext_resource type="Texture2D" uid="uid://ceebnlqxcbmlw" path="res://assets/plants/plantes mortes/plante_morte1.png" id="3_2wyd1"] [ext_resource type="Texture2D" uid="uid://d02mdx460lfgm" path="res://assets/plants/evolution2.4.png" id="4_rihq1"] +[ext_resource type="Texture2D" uid="uid://db46hrnjgcunf" path="res://assets/plants/evolution2.4_glow.png" id="5_erp4i"] [ext_resource type="Texture2D" uid="uid://d0xlqgttxwkgh" path="res://assets/plants/evolution2.png" id="5_i5m6k"] [sub_resource type="AtlasTexture" id="AtlasTexture_u2flf"] @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_rihq1") +}, { +"duration": 1.0, +"texture": ExtResource("5_erp4i") }], "loop": true, "name": &"GROWN", @@ -46,8 +50,8 @@ growing_time = 2.0 offspring_per_lifetime = 1 dying_time = 120.0 dead_time = 60.0 -water_need = [-5, 8] -fertility_need = [-1, 9] +water_need = [-5, 10] +fertility_need = [-1, 10] presence_need = [2, 19] water_prod = 4 fertility_prod = 0 @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 2 dead_fertility_prod = 0 distance_prod = 300 +distance_prod_falloff = 150 diff --git a/objects/plant_types/Elandorr.tres b/objects/plant_types/Elandorr.tres index d32479b..608a555 100644 --- a/objects/plant_types/Elandorr.tres +++ b/objects/plant_types/Elandorr.tres @@ -55,3 +55,4 @@ presence_prod = 1 dead_water_prod = 0 dead_fertility_prod = 1 distance_prod = 200 +distance_prod_falloff = 100 diff --git a/objects/plant_types/Konnidat.tres b/objects/plant_types/Konnidat.tres index 637a293..7f0ec69 100644 --- a/objects/plant_types/Konnidat.tres +++ b/objects/plant_types/Konnidat.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://di5eh5yvhanlt"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://di5eh5yvhanlt"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_1xwqx"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_5ijhj"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_3ueid"] [ext_resource type="Texture2D" uid="uid://34v3ub405uwp" path="res://assets/plants/evolution2.3.png" id="4_uv55b"] +[ext_resource type="Texture2D" uid="uid://bkq3n2q6m01e3" path="res://assets/plants/evolution2.3glow.png" id="5_olkuo"] [ext_resource type="Texture2D" uid="uid://d0xlqgttxwkgh" path="res://assets/plants/evolution2.png" id="5_vsmg7"] [sub_resource type="AtlasTexture" id="AtlasTexture_6mli1"] @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_uv55b") +}, { +"duration": 1.0, +"texture": ExtResource("5_olkuo") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 1 dead_fertility_prod = 1 distance_prod = 300 +distance_prod_falloff = 150 diff --git a/objects/plant_types/Lithoniel.tres b/objects/plant_types/Lithoniel.tres index 2b753db..c435b49 100644 --- a/objects/plant_types/Lithoniel.tres +++ b/objects/plant_types/Lithoniel.tres @@ -1,10 +1,12 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://cbvlod5m6s5pk"] +[gd_resource type="Resource" script_class="PlantType" load_steps=10 format=3 uid="uid://cbvlod5m6s5pk"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_sfd4l"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_5nqbe"] [ext_resource type="Texture2D" uid="uid://di74g50h3oruf" path="res://assets/plants/plantes mortes/arbre_mort.png" id="3_k1kks"] [ext_resource type="Texture2D" uid="uid://bu462tqc23ygm" path="res://assets/plants/arbre3.png" id="4_rhg44"] [ext_resource type="Texture2D" uid="uid://crgjmsk6ailnb" path="res://assets/plants/arbre3_bebe.png" id="5_43s5v"] +[ext_resource type="Texture2D" uid="uid://b2da8t4efoaqq" path="res://assets/plants/arbre3_glow.png" id="5_iiu8o"] +[ext_resource type="Texture2D" uid="uid://e3d3wchaado3" path="res://assets/plants/arbre3_bebe_glow.png" id="7_78ppv"] [sub_resource type="AtlasTexture" id="AtlasTexture_rihnu"] atlas = ExtResource("2_5nqbe") @@ -23,6 +25,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_rhg44") +}, { +"duration": 1.0, +"texture": ExtResource("5_iiu8o") }], "loop": true, "name": &"GROWN", @@ -31,6 +36,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("5_43s5v") +}, { +"duration": 1.0, +"texture": ExtResource("7_78ppv") }], "loop": true, "name": &"SAPLING", @@ -43,7 +51,7 @@ type = "Lithoniel" seed_sprite = SubResource("AtlasTexture_rihnu") sprite_frames = SubResource("SpriteFrames_8hq66") growing_time = 60.0 -offspring_per_lifetime = 0 +offspring_per_lifetime = 1 dying_time = 240.0 dead_time = 120.0 water_need = [2, 10] @@ -55,3 +63,4 @@ presence_prod = 4 dead_water_prod = 2 dead_fertility_prod = 4 distance_prod = 600 +distance_prod_falloff = 300 diff --git a/objects/plant_types/Mirut.tres b/objects/plant_types/Mirut.tres index 5bef12e..8993b5b 100644 --- a/objects/plant_types/Mirut.tres +++ b/objects/plant_types/Mirut.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://bbi00n5snleur"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://bbi00n5snleur"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_32rwi"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_liffp"] [ext_resource type="Texture2D" uid="uid://ceebnlqxcbmlw" path="res://assets/plants/plantes mortes/plante_morte1.png" id="3_4qc5e"] [ext_resource type="Texture2D" uid="uid://cmhajduampeuf" path="res://assets/plants/evolution3.1.png" id="4_6je8p"] +[ext_resource type="Texture2D" uid="uid://depyywow3yxex" path="res://assets/plants/evolution3.1glow.png" id="5_4or8w"] [ext_resource type="Texture2D" uid="uid://bhofpsc2gk2s8" path="res://assets/plants/evolution3.png" id="5_6yscv"] [sub_resource type="AtlasTexture" id="AtlasTexture_2qduo"] @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_6je8p") +}, { +"duration": 1.0, +"texture": ExtResource("5_4or8w") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 0 dead_fertility_prod = 1 distance_prod = 400 +distance_prod_falloff = 200 diff --git a/objects/plant_types/Naertho.tres b/objects/plant_types/Naertho.tres index 902350a..fe7488f 100644 --- a/objects/plant_types/Naertho.tres +++ b/objects/plant_types/Naertho.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://cg2ou1520k162"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://cg2ou1520k162"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_cmyhw"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_nese1"] [ext_resource type="Texture2D" uid="uid://ceebnlqxcbmlw" path="res://assets/plants/plantes mortes/plante_morte1.png" id="3_io6uv"] [ext_resource type="Texture2D" uid="uid://ouxdlglbbnme" path="res://assets/plants/evolution1.4.png" id="4_h2yn0"] +[ext_resource type="Texture2D" uid="uid://deckgdj2y50a0" path="res://assets/plants/evolution1.4glow.png" id="5_6v40j"] [ext_resource type="Texture2D" uid="uid://hkcjtfch0kub" path="res://assets/plants/evolution1.png" id="5_c6tg4"] [sub_resource type="AtlasTexture" id="AtlasTexture_b4v1x"] @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_h2yn0") +}, { +"duration": 1.0, +"texture": ExtResource("5_6v40j") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 1 dead_fertility_prod = 1 distance_prod = 400 +distance_prod_falloff = 200 diff --git a/objects/plant_types/Nakag.tres b/objects/plant_types/Nakag.tres index e2bbd39..c3c41fa 100644 --- a/objects/plant_types/Nakag.tres +++ b/objects/plant_types/Nakag.tres @@ -1,10 +1,11 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://3f0c3ant0i74"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://3f0c3ant0i74"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_incgu"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_7j0g4"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_qbnxd"] [ext_resource type="Texture2D" uid="uid://bi08m8a3ikw7j" path="res://assets/plants/evolution3.3.png" id="4_1gp5r"] [ext_resource type="Texture2D" uid="uid://bhofpsc2gk2s8" path="res://assets/plants/evolution3.png" id="5_gjb21"] +[ext_resource type="Texture2D" uid="uid://yjn26ei0e2du" path="res://assets/plants/evolution3.3glow.png" id="5_mhn2m"] [sub_resource type="AtlasTexture" id="AtlasTexture_6rb5i"] atlas = ExtResource("2_7j0g4") @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_1gp5r") +}, { +"duration": 1.0, +"texture": ExtResource("5_mhn2m") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 1 dead_water_prod = 0 dead_fertility_prod = 1 distance_prod = 200 +distance_prod_falloff = 100 diff --git a/objects/plant_types/Navarre.tres b/objects/plant_types/Navarre.tres index 467956a..6e833ad 100644 --- a/objects/plant_types/Navarre.tres +++ b/objects/plant_types/Navarre.tres @@ -1,10 +1,11 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://brcimvxigi5g7"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://brcimvxigi5g7"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_4c8pg"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_lyimn"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_ircru"] [ext_resource type="Texture2D" uid="uid://br1olfut3p0tx" path="res://assets/plants/evolution1.1.png" id="4_8xdmf"] [ext_resource type="Texture2D" uid="uid://hkcjtfch0kub" path="res://assets/plants/evolution1.png" id="5_3e24e"] +[ext_resource type="Texture2D" uid="uid://drxb6gfgib6b2" path="res://assets/plants/evolution1.1glow.png" id="5_n8mr6"] [sub_resource type="AtlasTexture" id="AtlasTexture_4k2ke"] atlas = ExtResource("2_lyimn") @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_8xdmf") +}, { +"duration": 1.0, +"texture": ExtResource("5_n8mr6") }], "loop": true, "name": &"GROWN", @@ -46,8 +50,8 @@ growing_time = 1.0 offspring_per_lifetime = 3 dying_time = 60.0 dead_time = 30.0 -water_need = [-1, 9] -fertility_need = [-5, 8] +water_need = [-1, 10] +fertility_need = [-5, 10] presence_need = [2, 19] water_prod = 0 fertility_prod = 4 @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 0 dead_fertility_prod = 2 distance_prod = 300 +distance_prod_falloff = 150 diff --git a/objects/plant_types/Neviusia.tres b/objects/plant_types/Neviusia.tres index d0734e8..c19f88c 100644 --- a/objects/plant_types/Neviusia.tres +++ b/objects/plant_types/Neviusia.tres @@ -1,10 +1,12 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://bje2xwse2ilga"] +[gd_resource type="Resource" script_class="PlantType" load_steps=10 format=3 uid="uid://bje2xwse2ilga"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_8y2m5"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_0bswh"] [ext_resource type="Texture2D" uid="uid://di74g50h3oruf" path="res://assets/plants/plantes mortes/arbre_mort.png" id="3_pmix4"] [ext_resource type="Texture2D" uid="uid://cbj6fmw8pxnsb" path="res://assets/plants/arbre4.png" id="4_4j1rk"] [ext_resource type="Texture2D" uid="uid://bxw81k0af64wo" path="res://assets/plants/arbre4_bebe.png" id="5_0d7t0"] +[ext_resource type="Texture2D" uid="uid://6sbvx064f20y" path="res://assets/plants/arbre4_glow.png" id="5_8ok3i"] +[ext_resource type="Texture2D" uid="uid://dvon76hnof5ny" path="res://assets/plants/arbre4_bebe_glow.png" id="7_jijhl"] [sub_resource type="AtlasTexture" id="AtlasTexture_e0ddp"] atlas = ExtResource("2_0bswh") @@ -23,6 +25,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_4j1rk") +}, { +"duration": 1.0, +"texture": ExtResource("5_8ok3i") }], "loop": true, "name": &"GROWN", @@ -31,6 +36,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("5_0d7t0") +}, { +"duration": 1.0, +"texture": ExtResource("7_jijhl") }], "loop": true, "name": &"SAPLING", @@ -43,7 +51,7 @@ type = "Neviusia" seed_sprite = SubResource("AtlasTexture_e0ddp") sprite_frames = SubResource("SpriteFrames_qtm0k") growing_time = 60.0 -offspring_per_lifetime = 0 +offspring_per_lifetime = 1 dying_time = 240.0 dead_time = 120.0 water_need = [0, 10] @@ -55,3 +63,4 @@ presence_prod = 4 dead_water_prod = 2 dead_fertility_prod = 2 distance_prod = 600 +distance_prod_falloff = 300 diff --git a/objects/plant_types/Oggamon.tres b/objects/plant_types/Oggamon.tres index 1301132..48f0d63 100644 --- a/objects/plant_types/Oggamon.tres +++ b/objects/plant_types/Oggamon.tres @@ -1,10 +1,11 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://dr17d2cg8cmar"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://dr17d2cg8cmar"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_mr0h0"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_e84rt"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_p1ccf"] [ext_resource type="Texture2D" uid="uid://bklqkrqhw6fdf" path="res://assets/plants/evolution2.2.png" id="4_bd3io"] [ext_resource type="Texture2D" uid="uid://d0xlqgttxwkgh" path="res://assets/plants/evolution2.png" id="5_3xk5n"] +[ext_resource type="Texture2D" uid="uid://b6yakjoc56ykx" path="res://assets/plants/evolution2.2glow.png" id="5_svnxg"] [sub_resource type="AtlasTexture" id="AtlasTexture_7ctak"] atlas = ExtResource("2_e84rt") @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_bd3io") +}, { +"duration": 1.0, +"texture": ExtResource("5_svnxg") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 1 dead_fertility_prod = 1 distance_prod = 400 +distance_prod_falloff = 200 diff --git a/objects/plant_types/Oogut.tres b/objects/plant_types/Oogut.tres index 719abd5..0ad475b 100644 --- a/objects/plant_types/Oogut.tres +++ b/objects/plant_types/Oogut.tres @@ -1,10 +1,11 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://d25s1eywvsyei"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://d25s1eywvsyei"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_4cghd"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_o8yby"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_feqkx"] [ext_resource type="Texture2D" uid="uid://bhqhdoxql4odd" path="res://assets/plants/evolution3.2.png" id="4_uxebp"] [ext_resource type="Texture2D" uid="uid://bhofpsc2gk2s8" path="res://assets/plants/evolution3.png" id="5_6hg7m"] +[ext_resource type="Texture2D" uid="uid://bb4t30vv1erc3" path="res://assets/plants/evolution3.2glow.png" id="5_nka4w"] [sub_resource type="AtlasTexture" id="AtlasTexture_1kvg0"] atlas = ExtResource("2_o8yby") @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_uxebp") +}, { +"duration": 1.0, +"texture": ExtResource("5_nka4w") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 1 dead_water_prod = 0 dead_fertility_prod = 1 distance_prod = 200 +distance_prod_falloff = 100 diff --git a/objects/plant_types/Ungrake.tres b/objects/plant_types/Ungrake.tres index d7f7a15..eab4a6c 100644 --- a/objects/plant_types/Ungrake.tres +++ b/objects/plant_types/Ungrake.tres @@ -1,10 +1,11 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://c64hhkqk4tnas"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://c64hhkqk4tnas"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_d77oo"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_3tp7g"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_6kltw"] [ext_resource type="Texture2D" uid="uid://24ift4wt1h2h" path="res://assets/plants/evolution2.1.png" id="4_cxwjh"] [ext_resource type="Texture2D" uid="uid://d0xlqgttxwkgh" path="res://assets/plants/evolution2.png" id="5_0cele"] +[ext_resource type="Texture2D" uid="uid://dj145jeb441ms" path="res://assets/plants/evolution2.1glow.png" id="5_diyuo"] [sub_resource type="AtlasTexture" id="AtlasTexture_efpgb"] atlas = ExtResource("2_3tp7g") @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_cxwjh") +}, { +"duration": 1.0, +"texture": ExtResource("5_diyuo") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 1 dead_water_prod = 0 dead_fertility_prod = 1 distance_prod = 200 +distance_prod_falloff = 100 diff --git a/objects/plant_types/Wyrran.tres b/objects/plant_types/Wyrran.tres index ed30226..cb71011 100644 --- a/objects/plant_types/Wyrran.tres +++ b/objects/plant_types/Wyrran.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" script_class="PlantType" load_steps=8 format=3 uid="uid://cev7wbg0cfel3"] +[gd_resource type="Resource" script_class="PlantType" load_steps=9 format=3 uid="uid://cev7wbg0cfel3"] [ext_resource type="Script" path="res://scripts/plant_type.gd" id="1_xvhlf"] [ext_resource type="Texture2D" uid="uid://b3kjaw1hajc6s" path="res://assets/grille_seeds.png" id="2_2wi5a"] [ext_resource type="Texture2D" uid="uid://cuujr7p18dv3g" path="res://assets/plants/plantes mortes/plante_morte2.png" id="3_0hwfl"] [ext_resource type="Texture2D" uid="uid://clnrdh4ygkrr8" path="res://assets/plants/evolution1.3.png" id="4_ee77a"] +[ext_resource type="Texture2D" uid="uid://dx8rc0ac1luab" path="res://assets/plants/evolution1.3_glow.png" id="5_evuaa"] [ext_resource type="Texture2D" uid="uid://hkcjtfch0kub" path="res://assets/plants/evolution1.png" id="5_xqm7x"] [sub_resource type="AtlasTexture" id="AtlasTexture_ssp8o"] @@ -23,6 +24,9 @@ animations = [{ "frames": [{ "duration": 1.0, "texture": ExtResource("4_ee77a") +}, { +"duration": 1.0, +"texture": ExtResource("5_evuaa") }], "loop": true, "name": &"GROWN", @@ -55,3 +59,4 @@ presence_prod = 2 dead_water_prod = 0 dead_fertility_prod = 2 distance_prod = 400 +distance_prod_falloff = 200 diff --git a/scenes/Gui.tscn b/scenes/Gui.tscn index 817fe99..aefe2d3 100644 --- a/scenes/Gui.tscn +++ b/scenes/Gui.tscn @@ -102,6 +102,13 @@ horizontal_alignment = 1 vertical_alignment = 1 autowrap_mode = 2 +[node name="Controls" type="TextureRect" parent="Tuto/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 0 +texture = ExtResource("8_0b6a6") +stretch_mode = 5 + [node name="Label2" type="Label" parent="Tuto/MarginContainer"] layout_mode = 2 size_flags_horizontal = 8 @@ -112,13 +119,6 @@ label_settings = SubResource("LabelSettings_y5jk3") horizontal_alignment = 1 vertical_alignment = 1 -[node name="Controls" type="TextureRect" parent="Tuto/MarginContainer"] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 0 -texture = ExtResource("8_0b6a6") -stretch_mode = 5 - [node name="RobotSpeak" type="AudioStreamPlayer" parent="Tuto"] stream = ExtResource("8_8y3ei") diff --git a/scenes/Map.tscn b/scenes/Map.tscn index 0aaed98..4088e07 100644 --- a/scenes/Map.tscn +++ b/scenes/Map.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://scripts/map.gd" id="1_3np0o"] [ext_resource type="PackedScene" uid="uid://6ferubyu2uy1" path="res://scenes/Scanners.tscn" id="1_6mlj0"] -[ext_resource type="PackedScene" uid="uid://byv2a5d0n1538" path="res://objects/Animal.tscn" id="4_pkphc"] +[ext_resource type="PackedScene" uid="uid://cj457q2fx5mim" path="res://objects/Animal.tscn" id="4_pkphc"] [ext_resource type="Texture2D" uid="uid://ci1oiftbr13ci" path="res://assets/texture/sol_gamejam_marais.png" id="5_fbt74"] [ext_resource type="Shader" path="res://scripts/shaders/TextureSplit.gdshader" id="5_iqvbx"] [ext_resource type="Texture2D" uid="uid://6h5ieh6ba7re" path="res://assets/texture/sol_gamejam_mort.png" id="6_wj5l3"] @@ -44,6 +44,7 @@ shader_parameter/texture_medium = SubResource("GradientTexture1D_hwe6p") shader_parameter/texture_high = ExtResource("8_6vuay") [node name="Map" type="Node2D"] +y_sort_enabled = true script = ExtResource("1_3np0o") [node name="Scanners" parent="." instance=ExtResource("1_6mlj0")] diff --git a/scripts/animal.gd b/scripts/animal.gd index 42e2da2..007c9a7 100644 --- a/scripts/animal.gd +++ b/scripts/animal.gd @@ -14,8 +14,8 @@ func _ready(): func _on_area_2d_area_entered(area: Area2D) -> void: var plant = area.get_parent() if plant is Plant and not is_liberated: - plant.grown.connect(tracked_plant_grew) - plant.died.connect(tracked_plant_died) + plant.grown.connect(tracked_plant_grew) + plant.died.connect(tracked_plant_died) func tracked_plant_grew(): if is_liberated: diff --git a/scripts/gui/seed_card.gd b/scripts/gui/seed_card.gd index eb81e28..6d3b7e8 100644 --- a/scripts/gui/seed_card.gd +++ b/scripts/gui/seed_card.gd @@ -37,6 +37,11 @@ func update_mouse_position(mouse_position): and mouse_position.x < GameTerrain.TERRAIN_SIZE.x * GameTerrain.MAP_RATIO and mouse_position.y < GameTerrain.TERRAIN_SIZE.y * GameTerrain.MAP_RATIO ): - waterNeeds.set_cursor(GameTerrain.get_color(mouse_position).r) - fertilityNeeds.set_cursor(GameTerrain.get_color(mouse_position).g) - populationNeeds.set_cursor(GameTerrain.get_color(mouse_position).b) + var next_seed_param := planter.get_plant_from_queue() + var needs := GameTerrain.get_levels(mouse_position) + var meet_water: bool = needs.x >= next_seed_param.water_need[0] and needs.x <= next_seed_param.water_need[1] + waterNeeds.set_cursor(GameTerrain.get_color(mouse_position).r, meet_water) + var meet_fert: bool = needs.y >= next_seed_param.fertility_need[0] and needs.y <= next_seed_param.fertility_need[1] + fertilityNeeds.set_cursor(GameTerrain.get_color(mouse_position).g, meet_fert) + var meet_pop: bool = needs.z + GameTerrain.LEVELS_NUMBER / 2 >= next_seed_param.presence_need[0] and needs.z + GameTerrain.LEVELS_NUMBER / 2 <= next_seed_param.presence_need[1] + populationNeeds.set_cursor(GameTerrain.get_color(mouse_position).b, meet_pop) diff --git a/scripts/gui/stats_area.gd b/scripts/gui/stats_area.gd index 033163d..05b5369 100644 --- a/scripts/gui/stats_area.gd +++ b/scripts/gui/stats_area.gd @@ -4,6 +4,8 @@ extends CenterContainer @export var gradient : GradientTexture1D const CURSOR_WIDTH = 0.04 +const VALID_COLOR := Color(0.1, 0.9, 0.85, 1.0) +const NOT_VALID_COLOR := Color(1.0, 0.0, 0.3, 1.0) # Called when the node enters the scene tree for the first time. func _ready(): @@ -29,7 +31,7 @@ func set_area(need : Array): $Zone.texture = texture -func set_cursor(color_value): +func set_cursor(color_value, is_valid: bool): var zone_grad := Gradient.new() zone_grad.interpolation_mode = Gradient.GRADIENT_INTERPOLATE_CONSTANT @@ -37,8 +39,13 @@ func set_cursor(color_value): zone_grad.set_color(0, Color(1,1,1,0)) zone_grad.set_color(1, Color(1,1,1,0)) - zone_grad.add_point(max(color_value - CURSOR_WIDTH/2, 0.0), Color(1,1,1,1)) - zone_grad.add_point(min(color_value + CURSOR_WIDTH/2, 1.0), Color(1,1,1,0)) + var color := NOT_VALID_COLOR + if is_valid: + color = VALID_COLOR + + zone_grad.add_point(max(color_value - CURSOR_WIDTH/2, 0.0), color) + color.a = 0 + zone_grad.add_point(min(color_value + CURSOR_WIDTH/2, 1.0), color) var texture := GradientTexture1D.new() diff --git a/scripts/plant.gd b/scripts/plant.gd index a95e8a0..e18c2a2 100644 --- a/scripts/plant.gd +++ b/scripts/plant.gd @@ -35,6 +35,10 @@ func _on_need_checker_timeout() -> void: can_grow = check_terrain_viability() growing_timer.paused = not can_grow and state == PlantState.SAPLING reproduction.paused = not can_grow + if can_grow: + sprite_node.frame = 1 + else: + sprite_node.frame = 0 func check_terrain_viability() -> bool: var water := GameTerrain.get_stat(position, GameTerrain.Stats.WATER) @@ -86,16 +90,19 @@ func grow(): state = PlantState.GROWN sapling_count_down.stop() growing_timer.start(parameter.dying_time) - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.WATER, parameter.water_prod) - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.FERTILITY, parameter.fertility_prod) - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.PRESENCE, parameter.presence_prod) @@ -109,16 +116,19 @@ func grow(): func die(): state = PlantState.DEAD # remove alive prod and add dead prod - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.WATER, -parameter.water_prod + parameter.dead_water_prod) - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.FERTILITY, -parameter.fertility_prod + parameter.dead_fertility_prod) - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.PRESENCE, -parameter.presence_prod) growing_timer.start(parameter.dead_time) @@ -128,12 +138,14 @@ func die(): func remove(was_dead: bool = true): if was_dead: - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.WATER, -parameter.dead_water_prod) - GameTerrain.modify_zone(position, + GameTerrain.modify_zone_falloff(position, parameter.distance_prod, + parameter.distance_prod_falloff, GameTerrain.Stats.FERTILITY, -parameter.dead_fertility_prod) queue_free() diff --git a/scripts/plant_type.gd b/scripts/plant_type.gd index 81bae97..8525aa8 100644 --- a/scripts/plant_type.gd +++ b/scripts/plant_type.gd @@ -24,3 +24,4 @@ extends Resource @export var dead_fertility_prod := 1 @export var distance_prod := 50 +@export var distance_prod_falloff := 10 diff --git a/scripts/terrain.gd b/scripts/terrain.gd index b674f3d..c62fc67 100644 --- a/scripts/terrain.gd +++ b/scripts/terrain.gd @@ -122,6 +122,29 @@ func modify_zone( ) update_texture() +func modify_zone_falloff( + center: Vector2, + radius: float, + falloff_extraradius: float, + stat : Stats, + modification: int +): + var pixel_center := map_to_pixel(center) + var pixel_radius := int(radius / MAP_RATIO) + var pixel_falloff_radius := int(falloff_extraradius / MAP_RATIO) + for x in range(pixel_center.x - pixel_radius - pixel_falloff_radius, pixel_center.x + pixel_radius + pixel_falloff_radius + 1) : + for y in range(pixel_center.y - pixel_radius - pixel_falloff_radius, pixel_center.y + pixel_radius + pixel_falloff_radius + 1): + if not is_on_map_image(Vector2i(x, y)): + continue + var pos := Vector2i(x, y) + var dist_to_center := pos.distance_to(pixel_center) + if dist_to_center <= pixel_radius: + modify_pixel(pos, stat, modification) + elif modification > 1 and dist_to_center <= pixel_radius + falloff_extraradius: + var new_modif = lerp(modification, 1, (dist_to_center - pixel_radius) / pixel_falloff_radius) + modify_pixel(pos, stat, new_modif) + update_texture() + func modify_rect( pos: Vector2, size: Vector2, @@ -145,14 +168,19 @@ func get_color( var pixel_pos = map_to_pixel(pos) return image.get_pixelv(pixel_pos) +func get_levels( + pos: Vector2, +) -> Vector3i: + if not is_on_map_real(pos): + return Vector3i() + var pixel_pos = map_to_pixel(pos) + return color_to_levels(image.get_pixelv(pixel_pos)) + func get_stat( pos: Vector2, stat : Stats ) -> int: - if not is_on_map_real(pos): - return 0 - var pixel_pos = map_to_pixel(pos) - var levels = color_to_levels(image.get_pixelv(pixel_pos)) + var levels = get_levels(pos) match stat: Stats.WATER: return levels.x diff --git a/scripts/tuto.gd b/scripts/tuto.gd index a33c774..6d4b805 100644 --- a/scripts/tuto.gd +++ b/scripts/tuto.gd @@ -2,7 +2,7 @@ extends Control var texts = [ "Hi there !", - "Welcome to GJ 238 b, it was a nice and hospitable exoplanet, but the humans settled in and ruined this place.", + "Welcome to MJ 166 b, it was a nice and hospitable exoplanet, but the humans settled in and ruined this place.", "Now nothing grows, and the animals won't show up !", "You got to help me with this, I prepared a lot of seeds, you just have to click and I'll plant.", "The problem is that the place is quite inhospitable, each plant needs a special amount of water, a certain quality of ground (the fertility), and more or less space (population).",