updates
This commit is contained in:
parent
4298caf5cb
commit
2e6638b744
19 changed files with 484 additions and 185 deletions
|
|
@ -8,20 +8,28 @@ extends RefCounted
|
|||
## kit classes (Scarecrow, Interactions, ScarecrowCombat) read this instead of the local Input
|
||||
## when their remote is set.
|
||||
|
||||
const ACTIONS: Array[StringName] = [&"fire", &"fear", &"patch", &"interact"]
|
||||
const ACTIONS: Array[StringName] = [&"fire", &"fear", &"patch", &"interact", &"offhand"]
|
||||
|
||||
var aim := Vector2(0.0, -1.0)
|
||||
var aim_point := Vector3.ZERO
|
||||
var ground_point := Vector3.ZERO
|
||||
## ScarecrowCombat.Device of the partner's aim, and its ScarecrowCombat.Weapon (-1: none said).
|
||||
## ScarecrowCombat.Device of the partner's aim, and its main ScarecrowCombat.Weapon (-1: none
|
||||
## said).
|
||||
var device: int = 0
|
||||
var weapon: int = -1
|
||||
var build_active := false
|
||||
var ui_open := false
|
||||
|
||||
var _held := 0
|
||||
var _presses := PackedInt32Array([0, 0, 0, 0])
|
||||
var _seen := PackedInt32Array([0, 0, 0, 0])
|
||||
var _presses := RemoteControls.counts()
|
||||
var _seen := RemoteControls.counts()
|
||||
|
||||
|
||||
## A count per action, all 0.
|
||||
static func counts() -> PackedInt32Array:
|
||||
var c := PackedInt32Array()
|
||||
c.resize(ACTIONS.size())
|
||||
return c
|
||||
|
||||
|
||||
func held(action: StringName) -> bool:
|
||||
|
|
@ -63,8 +71,8 @@ func release() -> void:
|
|||
|
||||
## The local side: an input record for the actions held now and every press so far.
|
||||
class Sender:
|
||||
var presses := PackedInt32Array([0, 0, 0, 0])
|
||||
var _was := PackedInt32Array([0, 0, 0, 0])
|
||||
var presses := RemoteControls.counts()
|
||||
var _was := RemoteControls.counts()
|
||||
|
||||
## Counts presses from input events (taps between two frames still count).
|
||||
func note(event: InputEvent) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue