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="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://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://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://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"]
|
[sub_resource type="Animation" id="Animation_y6mxj"]
|
||||||
resource_name = "Idle"
|
resource_name = "Idle"
|
||||||
|
|
@ -74,10 +75,32 @@ _data = {
|
||||||
"Idle": SubResource("Animation_y6mxj")
|
"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"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_eyufl"]
|
||||||
radius = 191.83
|
radius = 191.83
|
||||||
|
|
||||||
[node name="Dog" type="Node2D"]
|
[node name="Dog" type="Node2D" groups=["dog"]]
|
||||||
position = Vector2(-5, -1)
|
position = Vector2(-5, -1)
|
||||||
script = ExtResource("1_26pvc")
|
script = ExtResource("1_26pvc")
|
||||||
|
|
||||||
|
|
@ -87,6 +110,12 @@ libraries = {
|
||||||
}
|
}
|
||||||
autoplay = "Idle"
|
autoplay = "Idle"
|
||||||
|
|
||||||
|
[node name="DogHighlightAnimation" type="AnimationPlayer" parent="."]
|
||||||
|
libraries = {
|
||||||
|
"": SubResource("AnimationLibrary_t7soo")
|
||||||
|
}
|
||||||
|
autoplay = "Highlight"
|
||||||
|
|
||||||
[node name="DeathBox" type="Area2D" parent="."]
|
[node name="DeathBox" type="Area2D" parent="."]
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DeathBox"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DeathBox"]
|
||||||
|
|
@ -133,3 +162,10 @@ position = Vector2(5, 182.5)
|
||||||
rotation = 0.0818845
|
rotation = 0.0818845
|
||||||
texture = ExtResource("4_odrmk")
|
texture = ExtResource("4_odrmk")
|
||||||
offset = Vector2(2.5, 67.5)
|
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="."]
|
[node name="AreaHighlight" type="Sprite2D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
modulate = Color(1, 1, 0.160784, 0.345098)
|
modulate = Color(1, 1, 0.160784, 0.345098)
|
||||||
rotation = 6.28319
|
rotation = 5.02655
|
||||||
scale = Vector2(0.6, 0.6)
|
scale = Vector2(0.6, 0.6)
|
||||||
texture = ExtResource("3_xruiv")
|
texture = ExtResource("3_xruiv")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ level_name = "Level Four"
|
||||||
level_description = "Hazard introduction - it's a dog!"
|
level_description = "Hazard introduction - it's a dog!"
|
||||||
bees_available = 60
|
bees_available = 60
|
||||||
nectar_required = 100
|
nectar_required = 100
|
||||||
level_par = 4
|
level_par = 3
|
||||||
collector_enabled = true
|
collector_enabled = true
|
||||||
dancer_enabled = true
|
dancer_enabled = true
|
||||||
director_enabled = false
|
director_enabled = false
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ extends Node2D
|
||||||
class_name Dog
|
class_name Dog
|
||||||
|
|
||||||
@onready var death_box = $DeathBox
|
@onready var death_box = $DeathBox
|
||||||
|
@onready var outline = $AreaHighlight
|
||||||
|
|
||||||
var acquired_target : Bee = null
|
var acquired_target : Bee = null
|
||||||
var target_timer : float = 0.0
|
var target_timer : float = 0.0
|
||||||
|
|
@ -25,6 +26,12 @@ func _process(delta):
|
||||||
target_timer = 0.0
|
target_timer = 0.0
|
||||||
return
|
return
|
||||||
|
|
||||||
|
func show_outline():
|
||||||
|
outline.visible = true
|
||||||
|
|
||||||
|
func hide_outline():
|
||||||
|
outline.visible = false
|
||||||
|
|
||||||
|
|
||||||
func _on_body_entered(area):
|
func _on_body_entered(area):
|
||||||
if area.is_in_group("bee") and distracted == false:
|
if area.is_in_group("bee") and distracted == false:
|
||||||
|
|
|
||||||
|
|
@ -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 rules = get_parent().get_node("RulesComponent")
|
||||||
@onready var beehive = get_parent().get_node("Beehive")
|
@onready var beehive = get_parent().get_node("Beehive")
|
||||||
@onready var flowers = get_parent().get_node("Flowers")
|
@onready var flowers = get_parent().get_node("Flowers")
|
||||||
|
@onready var dog = null
|
||||||
@onready var drone_controls = %DroneControls
|
@onready var drone_controls = %DroneControls
|
||||||
@onready var ui_controls = get_parent().get_node("UiComponent")
|
@onready var ui_controls = get_parent().get_node("UiComponent")
|
||||||
@onready var spawned_drones_container = get_node("SpawnedDrones")
|
@onready var spawned_drones_container = get_node("SpawnedDrones")
|
||||||
|
|
@ -31,6 +32,10 @@ func _ready():
|
||||||
if !rules.game_rules.distractor_enabled:
|
if !rules.game_rules.distractor_enabled:
|
||||||
%SpawnDistractor.visible = false
|
%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
|
## Function to detect right click event
|
||||||
func _input(event) -> void:
|
func _input(event) -> void:
|
||||||
if spawning_drone:
|
if spawning_drone:
|
||||||
|
|
@ -104,6 +109,8 @@ func _on_spawn_collector_pressed() -> void:
|
||||||
place_drone("collector")
|
place_drone("collector")
|
||||||
|
|
||||||
func _on_spawn_distractor_pressed() -> void:
|
func _on_spawn_distractor_pressed() -> void:
|
||||||
|
if dog:
|
||||||
|
dog.show_outline()
|
||||||
place_drone("distractor")
|
place_drone("distractor")
|
||||||
|
|
||||||
func _on_spawn_dancer_pressed() -> void:
|
func _on_spawn_dancer_pressed() -> void:
|
||||||
|
|
@ -122,6 +129,8 @@ func _on_spawn_collector_mouse_entered():
|
||||||
|
|
||||||
func _on_spawn_distractor_mouse_entered():
|
func _on_spawn_distractor_mouse_entered():
|
||||||
reset_node_highlights()
|
reset_node_highlights()
|
||||||
|
if dog:
|
||||||
|
dog.show_outline()
|
||||||
ui_controls.show_help_text("Help_Drone_Placement_Distractor")
|
ui_controls.show_help_text("Help_Drone_Placement_Distractor")
|
||||||
|
|
||||||
func _on_spawn_dancer_mouse_entered():
|
func _on_spawn_dancer_mouse_entered():
|
||||||
|
|
@ -178,3 +187,6 @@ func reset_node_highlights():
|
||||||
ui_controls.hide_help_text()
|
ui_controls.hide_help_text()
|
||||||
beehive.hide_outline()
|
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