Key | Description |
---|---|
Mouse |
Look around. Depending on your current action and held object, character turn speed might be limited. |
WASD |
Walk. |
Space |
Hold to jump higher, then release. Slows you down while you're charging your jump. |
Shift |
Sprint. Uses stamina, similar to other actions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros | |
macro foo(i: static[int]): untyped = | |
echo $i | |
foo(1) | |
foo(2) | |
macro foo2(i: static[int]): untyped = | |
echo $i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import | |
macros, | |
options, | |
sets, | |
strutils, | |
typetraits | |
macro foo(i: static[int]): untyped = | |
echo $i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsonschema: | |
GltfId: Natural | |
GltfProperty: | |
extensions: JsonNode | |
extras: JsonNode | |
GltfAsset extends GltfProperty: | |
version: string ## The glTF version that this asset targets. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import | |
macros, | |
options, | |
sets, | |
strutils, | |
typetraits | |
type | |
Either2*[T0, T1] = object | |
case which: range[0..1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsonschema: | |
GltfId: Natural | |
GltfProperty: | |
extensions: JsonNode | |
extras: JsonNode | |
GltfAsset extends GltfProperty: | |
version: string ## The glTF version that this asset targets. | |
minVersion?: string ## The minimum glTF version that this asset targets. | |
copyright?: string ## A copyright message suitable for display to credit the content creator. | |
generator?: string ## Tool that generated this glTF model. Useful for debugging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import | |
future, | |
macros, | |
options | |
export UnpackError | |
type | |
Result*[T,Err] = object | |
## A type which stores the result value of a procedure, or error if one occurred. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros | |
type | |
EventHandler*[T] = proc(event: T) | |
Event*[T] = distinct seq[EventHandler[T]] | |
proc newEvent*[T](): Event[T] = | |
result = newSeq[EventHandler[T]]() | |
proc subscribe*[T](ev: Event[T], handler: EventHandler[T]) = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros | |
type | |
EventHandler*[T] = proc(event: T) | |
EventStore[T] = seq[EventHandler[T]] | |
proc getEventStore[T](): var EventStore[T] = | |
static var store = newSeq[T]() | |
result = store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# input.nim | |
event InputEvent: | |
time: uint32 | |
MouseDown, MouseUp: | |
mousePosition: Point | |
KeyUp, KeyDown: | |
keysym: KeySym | |
# In module 1 |