who the fuck knows

This commit is contained in:
Dan 2024-05-08 17:06:15 +01:00
parent 1c33ea2f59
commit 1da411cacd
31 changed files with 1372 additions and 78 deletions

View file

@ -6,10 +6,17 @@ class_name BeeGathering
var time_at_patch : float = 0.0
var target : Vector2 = Vector2.ZERO
func enter(_msg := {}):
bee.just_gathering = true
Log.pr("Gathering now...")
randomize()
target = bee.get_global_position() + Vector2(randi_range(-100, 100), randi_range(-100, 100))
#animator.play("Idle")
#if !bee.in_range_of_flowers:
@ -30,3 +37,9 @@ func update(_delta : float):
else:
state_transition.emit(self, "Idle")
func physics_update(delta : float) -> void:
if target:
if bee.position.distance_to(target) > 2:
bee.velocity = (target - bee.position).normalized() * bee.speed / 2 * delta
bee.move_and_collide(bee.velocity)
bee.look_at(target)