-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.ts
42 lines (33 loc) · 1.28 KB
/
app.ts
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
namespace microcode {
// Auto-save slot
export const SAVESLOT_AUTO = "sa"
export interface SavedState {
progdef: any
version?: string
}
/**
* If an Arcade Shield is not present when starting MicroData that Microbit will enter DistributedLoggingProtocol.
* It will show a :) on its LEDs and try to become a Target - where it will receive radio commands from a Commander Microbit (one with an Arcade Shield)
*/
export class App {
sceneManager: SceneManager
constructor() {
// One interval delay to ensure all static constructors have executed.
basic.pause(10)
reportEvent("app.start")
this.sceneManager = new SceneManager()
datalogger.includeTimestamp(FlashLogTimeStampFormat.None)
const arcadeShieldConnected = shieldhelpers.shieldPresent();
if (arcadeShieldConnected)
this.pushScene(new Home(this))
else
new DistributedLoggingProtocol(this, false);
}
public pushScene(scene: Scene) {
this.sceneManager.pushScene(scene)
}
public popScene() {
this.sceneManager.popScene()
}
}
}