Add RulesComponent, GameRulesResource, and BeeDeath state. Update Bee entity with death animation. Include new textures for particles. Add Highlight animation to Beehive.

This commit is contained in:
Dan 2024-05-09 15:08:57 +01:00
parent 1da411cacd
commit d879ca30bd
222 changed files with 3980 additions and 149 deletions

View file

@ -5,6 +5,8 @@ class_name Bee
@onready var drone_manager = get_tree().get_first_node_in_group("dronemanager") as DroneManager
@onready var bee_position_animation = $BeePositionAnimation as AnimationPlayer
@onready var bee_wing_animation = $WingAnimation as AnimationPlayer
@onready var bee_body = $BeeBody as Sprite2D
@onready var impact_cloud : CPUParticles2D = $ImpactCloud
@export var nectar : int = 0
@export var speed : int = 30
@ -16,6 +18,8 @@ var in_range_of_flowers : bool = false
var just_gathering : bool = false # Used to check if the bee has just been gathering to return to their previous director
func _ready():
modulate = Color(1,1,1,1)
impact_cloud.visible = false
speed = randi_range(35,55) # Randomise the bee speed a bit
bee_wing_animation.play("Fly")
@ -61,8 +65,7 @@ func deposit_nectar():
func die():
# Move to the death state
# For now just remove the bee...
queue_free()
fsm.force_change_state("Death")

View file

@ -3,6 +3,14 @@ class_name Beehive
var dancer_in_range : bool = false
@onready var outline = $AreaHighlight
func show_outline():
outline.visible = true
func hide_outline():
outline.visible = false
func _on_area_2d_area_entered(area:Area2D):
if area.is_in_group("dancer"):
dancer_in_range = true

View file

@ -0,0 +1,10 @@
extends Node2D
class_name Flowers
@onready var outline = $AreaHighlight
func show_outline():
outline.visible = true
func hide_outline():
outline.visible = false

View file

@ -0,0 +1,12 @@
extends Node2D
class_name VegetablePatch
@onready var death_box = $DeathBox
func _ready():
death_box.connect("body_entered", Callable(self, "_on_body_entered"))
func _on_body_entered(area):
if area.is_in_group("bee"):
area.die()