fix de l'intro et de l'actualisation de score
This commit is contained in:
@@ -17,7 +17,7 @@ var size = PlanetData.DEFAULT_GARDEN_SIZE
|
||||
func _init(_planet_data : PlanetData, _initial_plants : Array[Plant] = []):
|
||||
planet_data = _planet_data
|
||||
plants = _initial_plants
|
||||
update_garden_score()
|
||||
# update_garden_score()
|
||||
|
||||
func _ready():
|
||||
contamination_sprite = generate_contamination_terrain_sprite()
|
||||
@@ -26,7 +26,7 @@ func _ready():
|
||||
for p in plants:
|
||||
p.harvested.connect(_on_plant_harvested)
|
||||
p.state_changed.connect(_on_plant_state_changed)
|
||||
update_garden_score()
|
||||
# update_garden_score()
|
||||
|
||||
func generate_contamination_terrain_sprite() -> Polygon2D:
|
||||
if not planet_data.garden_contamination:
|
||||
@@ -69,6 +69,9 @@ func plant(
|
||||
planet_data.score_by_plant.append(0)
|
||||
new_plant.harvested.connect(_on_plant_harvested)
|
||||
new_plant.state_changed.connect(_on_plant_state_changed)
|
||||
new_plant.ready.connect(
|
||||
func(): update_garden_score()
|
||||
)
|
||||
return new_plant
|
||||
|
||||
func _on_plant_state_changed(_p: Plant):
|
||||
|
||||
Reference in New Issue
Block a user