Refactor bee gather state and update game state

Removed unused code in the bee gathering function, enhancing readability. Also added a new boolean variable 'spawn_snails' in the game state reset function to control snail spawning.
This commit is contained in:
Dan Baker 2024-05-14 18:47:28 +01:00
parent 908f834181
commit 513b0c92a7
2 changed files with 1 additions and 9 deletions

View file

@ -16,15 +16,6 @@ func enter(_msg := {}):
randomize() randomize()
target = bee.get_global_position() + Vector2(randi_range(-100, 100), randi_range(-100, 100)) target = bee.get_global_position() + Vector2(randi_range(-100, 100), randi_range(-100, 100))
#animator.play("Idle")
#if !bee.in_range_of_flowers:
# ## Go home bee, you're drunk
# state_transition.emit(self, "Idle")
func update(_delta : float): func update(_delta : float):
if bee.in_range_of_flowers: if bee.in_range_of_flowers:

View file

@ -90,6 +90,7 @@ func reset():
gathered_nectar = 0 gathered_nectar = 0
drones_used = 0 drones_used = 0
dead_bees = 0 dead_bees = 0
spawn_snails = false
func reset_cursor(): func reset_cursor():
Input.set_custom_mouse_cursor(default_cursor, Input.CURSOR_ARROW, Vector2(8, 8)) Input.set_custom_mouse_cursor(default_cursor, Input.CURSOR_ARROW, Vector2(8, 8))