plusieurs amélioration mineure du gameplay et de la qualité de vie
This commit is contained in:
@@ -2,7 +2,6 @@ extends Area2D
|
||||
class_name Plant
|
||||
|
||||
const PLANT_AREA_WIDTH = 10
|
||||
const PLANT_SPRITE_SCALE = 0.15
|
||||
const HARVESTED_SEED_POSITION_RANGE = 100
|
||||
|
||||
const RANDOM_MAX_GROW_INTERVAL = 0.4
|
||||
@@ -55,9 +54,11 @@ func set_day(d):
|
||||
if day == 0:
|
||||
change_state(State.PLANTED)
|
||||
if day > plant_type.growing_time:
|
||||
change_state(State.MATURE)
|
||||
if state != State.MATURE:
|
||||
change_state(State.MATURE)
|
||||
else:
|
||||
change_state(State.GROWING)
|
||||
if state != State.GROWING:
|
||||
change_state(State.GROWING)
|
||||
|
||||
func change_state(_state: State):
|
||||
state = _state
|
||||
|
||||
@@ -10,6 +10,7 @@ func apply_texture_to_sprite(texture, with_animation = true):
|
||||
$AnimationPlayer.play("bump")
|
||||
await $AnimationPlayer.animation_finished
|
||||
sprite.texture = texture
|
||||
sprite.flip_h = true if randi()%2 == 0 else false
|
||||
|
||||
func start_harvest_animation():
|
||||
$AnimationPlayer.play("harvest")
|
||||
|
||||
Reference in New Issue
Block a user