1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// This is the canonical "Hello World" example for Bracket Terminal.
// It is crammed into one file, and kept as short as possible
//////////////////////////////////////////////////////////////
// We're using BTerm (the main context) and GameState (a trait defining what our callback
// looks like), so we need to use that, too.`
use *;
// We're utilizing functionality from BTerm, so we need to tell it to use the crate.
add_wasm_support!;
// This is the structure that will store our game state, typically a state machine pointing to
// other structures. This demo is realy simple, so we'll just put the minimum to make it work
// in here.
// We have to implement the "trait" GameState for our state object. This gives it a callback
// point for the main loop.
// Every program needs a main() function!