Handbook
Glossary
check-cocoa-controls ( world -- )
Vocabulary
terrain
.
smoke-test
Inputs
world
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
math.vectors.simd
namespaces
sequences
terrain
ui.backend.input-state
;
IN:
terrain.smoke-test
::
check-cocoa-controls
( world -- )
clear-input-state
world
player>>
:>
player player
float-4{
0.0 0.0 0.0 1.0
}
>>velocity
drop
13
t
record-key
world
handle-input
player
velocity>>
third
0.0
<
t
assert=
13
f
record-key
world
handle-input
terrain-keys
[
not
]
all?
t
assert=
56
t
record-key
world
handle-input
player
velocity-modifier>>
VELOCITY-MODIFIER-FAST
assert=
56
f
record-key
player
pitch>>
:>
pitch
current-input-state
get-global
{
10 10
}
>>motion
drop
world
handle-input
player
pitch>>
pitch
>
t
assert=
current-input-state
get-global
motion>>
{
0 0
}
assert=
clear-input-state
;