Basic player controls and aiming

This commit is contained in:
Haze Weathers 2024-08-21 21:02:35 -04:00
parent 56695d303e
commit f5999da412
114 changed files with 6611 additions and 2 deletions

View file

@ -0,0 +1,17 @@
## A guard that checks if a certain state is active.
class_name StateIsActiveGuard
extends Guard
const DebugUtil = preload("debug_util.gd")
## The state to be checked. When null this guard will return false.
@export_node_path("StateChartState") var state: NodePath
func is_satisfied(context_transition:Transition, context_state:StateChartState) -> bool:
## resolve the state, relative to the transition
var actual_state := context_transition.get_node_or_null(state)
if actual_state == null:
push_warning("State ", state , " referenced in StateIsActiveGuard below ", DebugUtil.path_of(context_state), " could not be resolved. Verify that the node path is correct.")
return false
return actual_state.active