ajouts d'objectifs sur la carte, déplacements des icônes et divers changements

This commit is contained in:
2025-09-13 12:48:52 +02:00
parent e56ec31069
commit 85cd832864
81 changed files with 983 additions and 307 deletions

View File

@@ -2,7 +2,7 @@ extends InspectableEntity
class_name Plant
const PLANT_AREA_WIDTH = 20
const HARVESTED_SEED_POSITION_RANGE = 100
const HARVESTED_SEED_DISPLACEMENT_FACTOR = 100
const RANDOM_MAX_GROW_INTERVAL = Planet.PASS_DAY_ANIMATION_TIME/2. - 0.1
@@ -88,24 +88,12 @@ func harvest():
var seed_plant_type : PlantType = plant_type
if len(plant_type.harvest_types_path):
seed_plant_type = load(plant_type.harvest_types_path.pick_random())
loot_seed(seed_plant_type)
planet.drop_item(
Seed.new(seed_plant_type),
global_position,
HARVESTED_SEED_DISPLACEMENT_FACTOR,
)
plant_sprite.start_harvest_animation()
await plant_sprite.harvest_animation_finished
queue_free()
func loot_seed(type : PlantType):
var item_object = planet.drop_item(
Seed.new(type),
global_position
)
var tween : Tween = get_tree().create_tween()
tween.tween_property(
item_object,
"position",
Vector2(
item_object.position.x + randi()%HARVESTED_SEED_POSITION_RANGE,
item_object.position.y + randi()%HARVESTED_SEED_POSITION_RANGE
),
0.2
)