Bee flying animation, dancing drone
This commit is contained in:
parent
7c3bca07f9
commit
bce75a9a97
13 changed files with 154 additions and 21 deletions
|
|
@ -8,6 +8,7 @@ var time_at_patch : float = 0.0
|
|||
|
||||
func enter(_msg := {}):
|
||||
Log.pr("I am going to attempt to gather some stuff!")
|
||||
bee.just_gathering = true
|
||||
#animator.play("Idle")
|
||||
|
||||
#if !bee.in_range_of_flowers:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class_name BeeIdle
|
|||
|
||||
@export var animator : AnimationPlayer
|
||||
|
||||
@onready var bee = get_parent().get_parent() # I think this is bad but I dont care it works
|
||||
@onready var bee = get_parent().get_parent() as Bee # I think this is bad but I dont care it works
|
||||
|
||||
var idle_time : float = 0.0
|
||||
|
||||
|
|
|
|||
17
entities/bee/states/bee_sleeping.gd
Normal file
17
entities/bee/states/bee_sleeping.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends State
|
||||
class_name BeeSleeping
|
||||
|
||||
@onready var bee = get_parent().get_parent() as Bee # I think this is bad but I dont care it works
|
||||
|
||||
var time_at_patch : float = 0.0
|
||||
|
||||
func enter(_msg := {}):
|
||||
Log.pr("BuzzzZZZzzzZZZZzzz (Sleeping)!")
|
||||
#animator.play("Idle")
|
||||
|
||||
func update(_delta : float):
|
||||
|
||||
# If there is a dancing bee in range of the hive then
|
||||
# we have a chance to wake up the bee...
|
||||
|
||||
pass
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
extends State
|
||||
class_name BeeTravelling
|
||||
|
||||
@export var animator : AnimationPlayer
|
||||
|
||||
@export var target : Drone = null
|
||||
|
||||
@onready var bee = get_parent().get_parent() as Bee # I think this is bad but I dont care it works
|
||||
|
|
@ -12,13 +10,17 @@ var t = 0
|
|||
func enter(_msg := {}):
|
||||
Log.pr("I am on the move!")
|
||||
## Get the next target location from the bee
|
||||
target = bee.get_next_target()
|
||||
if bee.just_gathering:
|
||||
target = bee.get_current_director() # We want to go back the way we came
|
||||
bee.just_gathering = false
|
||||
else:
|
||||
target = bee.get_next_target()
|
||||
|
||||
#animator.play("Idle")
|
||||
bee.animation_player.play("Flying")
|
||||
|
||||
pass
|
||||
|
||||
func update(delta : float):
|
||||
func update(delta : float) -> void:
|
||||
|
||||
if target:
|
||||
if bee.position.distance_to(target.position) > 3:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue