ajout des graines procédurales et des cinamatiques

This commit is contained in:
2026-02-21 14:29:36 +01:00
parent 2e4a1bab53
commit ca0133bd71
117 changed files with 1238 additions and 590 deletions

View File

@@ -9,6 +9,11 @@ const PARTICLES_SCENE : PackedScene = preload("res://common/vfx/particles/effect
signal harvest_animation_finished
var last_updated_on_state : PlantData.State = PlantData.State.MATURE
var stored_seed_image : Texture = null
func setup_plant_sprite(plant_data : PlantData):
%PlantedSeed.texture = PlantTextureBuilder.build_seed_texture(plant_data.plant_name.hash())
update_plant_sprite(plant_data,true)
func update_plant_sprite(plant_data : PlantData, with_animation = false):
if with_animation:
@@ -17,8 +22,7 @@ func update_plant_sprite(plant_data : PlantData, with_animation = false):
%Sprite.flip_h = true if plant_data.random_seed%2 == 0 else false
%Sprite.texture = PlantTextureBuilder.build_plant_texture(plant_data)
%PlantedSeed.texture = PlantTextureBuilder.build_seed_texture(plant_data.random_seed)
%PlantedSeed.visible = plant_data.get_state() == PlantData.State.PLANTED
# %PlantedSeed.region_rect = Rect2(