Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scenes/game_elements/characters/player/components/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const DEFAULT_SPRITE_FRAME: SpriteFrames = preload("uid://vwf8e1v8brdp")

var _initial_speeds: CharacterSpeeds

var _system_controllers: Array[Node] = []

@onready var input_walk_behavior: InputWalkBehavior = %InputWalkBehavior
@onready var player_interaction: PlayerInteraction = %PlayerInteraction
@onready var player_repel: Node2D = %PlayerRepel
Expand Down Expand Up @@ -223,12 +225,15 @@ func defeat(falling: bool = false) -> void:
_handle_game_over()


func take_control(_controlled_by: Node) -> void:
func take_control(controlled_by: Node) -> void:
_system_controllers.append(controlled_by)
mode = Mode.SYSTEM_CONTROLLED


func return_control(_controlled_by: Node) -> void:
mode = Mode.USER_CONTROLLED
func return_control(controlled_by: Node) -> void:
_system_controllers.erase(controlled_by)
if not _system_controllers:
mode = Mode.USER_CONTROLLED


func _toggle_abilities() -> void:
Expand Down