Skip to content

Commit 3c3803e

Browse files
committed
Show off export range and added explicit death chance.
1 parent 1d3a49b commit 3c3803e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Projects/split/scenes/world.tscn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ zoom = Vector2(0.49, 0.49)
1616

1717
[node name="Root" parent="." instance=ExtResource("2_k2vro")]
1818
unique_name_in_owner = true
19-
2019
position = Vector2(0, 633)
2120
scale = Vector2(2, 2)
2221

@@ -25,7 +24,6 @@ offset_left = -1112.0
2524
offset_top = -606.0
2625
offset_right = -977.0
2726
offset_bottom = -566.0
28-
2927
script = ExtResource("3_yikaj")
3028

3129
[node name="Label" type="Label" parent="PanelContainer"]

Projects/split/scripts/grow.gd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
extends Node2D
22

33
@export var tree_seed:int
4-
@export var grow_chance = 0.94
5-
@export var split_chance = 0.05
6-
@export var timer = 0.25
4+
@export_range(0.0, 1.0, 0.01) var grow_chance : float = 0.94
5+
@export_range(0.0, 1.0, 0.01) var split_chance = 0.05
6+
@export_range(0.0, 1.0, 0.01) var death_chance = 0.01
7+
@export_range(0.0, 2.0, 0.1) var timer : float = 0.2
8+
79
@export var manual:bool = false
810

911
var leaders = []
@@ -66,7 +68,7 @@ func _process(delta: float) -> void:
6668
removeList.append(leader)
6769
addList.append(growth)
6870

69-
else:
71+
if randomValue < split_chance + grow_chance + death_chance:
7072
removeList.append(leader)
7173

7274
for oldLeader in removeList:

0 commit comments

Comments
 (0)