diff options
Diffstat (limited to 'client/player/character/character.gd')
| -rw-r--r-- | client/player/character/character.gd | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/client/player/character/character.gd b/client/player/character/character.gd index 820cba74..36ff1323 100644 --- a/client/player/character/character.gd +++ b/client/player/character/character.gd @@ -1,18 +1,18 @@ # Undercooked - a game about cooking # Copyright 2024 tpart -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -# +# extends Node3D class_name Character @@ -21,6 +21,8 @@ const WALK_ANIM_SPEED:= 15.0 var walking := false var holding := false +var boosting := false +var was_boosting := boosting var current_animation := "idle" @@ -28,6 +30,8 @@ var current_animation := "idle" @onready var main = $Main @onready var default_height = main.position.y @onready var main_height_target = default_height +@onready var walking_particles = $Walking +@onready var boosting_particles = $Boosting @onready var hairstyles = { "Brown": $Main/Head/Hair, @@ -46,7 +50,7 @@ func _process(delta): else: t = 0 main.position.y = main_height_target - + # Update animation: var next_animation: String if holding: @@ -55,7 +59,11 @@ func _process(delta): next_animation = "walk" else: next_animation = "idle" - + + walking_particles.emitting = walking + boosting_particles.emitting = boosting and walking and not was_boosting + was_boosting = boosting and walking + if current_animation != next_animation: play_animation(next_animation) |