Update Dog entity with new animations, textures, and highlight feature. Adjust Flower rotation. Decrease level 4 par time. Add outline functionality to Drone Manager for Dog entity highlighting.
This commit is contained in:
parent
11f8c1d815
commit
6e6a231300
5 changed files with 61 additions and 6 deletions
|
|
@ -1,9 +1,10 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://cfhoi2rqxa3up"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://cfhoi2rqxa3up"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/scripts/dog.gd" id="1_26pvc"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqs2lfakkpqib" path="res://resources/textures/dog_body.png" id="2_mewoo"]
|
||||
[ext_resource type="Texture2D" uid="uid://b22isfr66b8y2" path="res://resources/textures/dog_head.png" id="3_d7db6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwxbit5i2x2ti" path="res://resources/textures/dog_tail.png" id="4_odrmk"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhf4dessaw5p5" path="res://resources/particles/twirl_01.png" id="5_dwvih"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_y6mxj"]
|
||||
resource_name = "Idle"
|
||||
|
|
@ -74,10 +75,32 @@ _data = {
|
|||
"Idle": SubResource("Animation_y6mxj")
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ajt0l"]
|
||||
resource_name = "Highlight"
|
||||
length = 5.0
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AreaHighlight:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [6.28319, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_t7soo"]
|
||||
_data = {
|
||||
"Highlight": SubResource("Animation_ajt0l")
|
||||
}
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_eyufl"]
|
||||
radius = 191.83
|
||||
|
||||
[node name="Dog" type="Node2D"]
|
||||
[node name="Dog" type="Node2D" groups=["dog"]]
|
||||
position = Vector2(-5, -1)
|
||||
script = ExtResource("1_26pvc")
|
||||
|
||||
|
|
@ -87,6 +110,12 @@ libraries = {
|
|||
}
|
||||
autoplay = "Idle"
|
||||
|
||||
[node name="DogHighlightAnimation" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_t7soo")
|
||||
}
|
||||
autoplay = "Highlight"
|
||||
|
||||
[node name="DeathBox" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DeathBox"]
|
||||
|
|
@ -133,3 +162,10 @@ position = Vector2(5, 182.5)
|
|||
rotation = 0.0818845
|
||||
texture = ExtResource("4_odrmk")
|
||||
offset = Vector2(2.5, 67.5)
|
||||
|
||||
[node name="AreaHighlight" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
modulate = Color(1, 0.0980392, 0.160784, 0.345098)
|
||||
rotation = 0.633674
|
||||
scale = Vector2(0.8, 0.8)
|
||||
texture = ExtResource("5_dwvih")
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ shape = SubResource("CircleShape2D_1tovu")
|
|||
[node name="AreaHighlight" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
modulate = Color(1, 1, 0.160784, 0.345098)
|
||||
rotation = 6.28319
|
||||
rotation = 5.02655
|
||||
scale = Vector2(0.6, 0.6)
|
||||
texture = ExtResource("3_xruiv")
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ level_name = "Level Four"
|
|||
level_description = "Hazard introduction - it's a dog!"
|
||||
bees_available = 60
|
||||
nectar_required = 100
|
||||
level_par = 4
|
||||
level_par = 3
|
||||
collector_enabled = true
|
||||
dancer_enabled = true
|
||||
director_enabled = false
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ extends Node2D
|
|||
class_name Dog
|
||||
|
||||
@onready var death_box = $DeathBox
|
||||
@onready var outline = $AreaHighlight
|
||||
|
||||
var acquired_target : Bee = null
|
||||
var target_timer : float = 0.0
|
||||
|
|
@ -23,7 +24,13 @@ func _process(delta):
|
|||
acquired_target.die()
|
||||
acquired_target = null
|
||||
target_timer = 0.0
|
||||
return
|
||||
return
|
||||
|
||||
func show_outline():
|
||||
outline.visible = true
|
||||
|
||||
func hide_outline():
|
||||
outline.visible = false
|
||||
|
||||
|
||||
func _on_body_entered(area):
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ var director_drones : Array = [] # List of all director drones in the world
|
|||
@onready var rules = get_parent().get_node("RulesComponent")
|
||||
@onready var beehive = get_parent().get_node("Beehive")
|
||||
@onready var flowers = get_parent().get_node("Flowers")
|
||||
@onready var dog = null
|
||||
@onready var drone_controls = %DroneControls
|
||||
@onready var ui_controls = get_parent().get_node("UiComponent")
|
||||
@onready var spawned_drones_container = get_node("SpawnedDrones")
|
||||
|
|
@ -31,6 +32,10 @@ func _ready():
|
|||
if !rules.game_rules.distractor_enabled:
|
||||
%SpawnDistractor.visible = false
|
||||
|
||||
# dog = get_parent().get_node("Dog")
|
||||
if get_parent().has_node("Dog"):
|
||||
dog = get_parent().get_node("Dog")
|
||||
|
||||
## Function to detect right click event
|
||||
func _input(event) -> void:
|
||||
if spawning_drone:
|
||||
|
|
@ -104,6 +109,8 @@ func _on_spawn_collector_pressed() -> void:
|
|||
place_drone("collector")
|
||||
|
||||
func _on_spawn_distractor_pressed() -> void:
|
||||
if dog:
|
||||
dog.show_outline()
|
||||
place_drone("distractor")
|
||||
|
||||
func _on_spawn_dancer_pressed() -> void:
|
||||
|
|
@ -122,6 +129,8 @@ func _on_spawn_collector_mouse_entered():
|
|||
|
||||
func _on_spawn_distractor_mouse_entered():
|
||||
reset_node_highlights()
|
||||
if dog:
|
||||
dog.show_outline()
|
||||
ui_controls.show_help_text("Help_Drone_Placement_Distractor")
|
||||
|
||||
func _on_spawn_dancer_mouse_entered():
|
||||
|
|
@ -177,4 +186,7 @@ func get_collector():
|
|||
func reset_node_highlights():
|
||||
ui_controls.hide_help_text()
|
||||
beehive.hide_outline()
|
||||
flowers.hide_outline()
|
||||
flowers.hide_outline()
|
||||
|
||||
if dog:
|
||||
dog.hide_outline()
|
||||
Loading…
Add table
Add a link
Reference in a new issue