-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.ts
34 lines (22 loc) · 952 Bytes
/
test.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
// tests go here; this will not be compiled when this package is used as an extension.
let list = [tilemap`level1`, tilemap`level3`, tilemap`level4`]
tiles.setCurrentTilemap(list[0])
const s1 = sprites.create(img`5 5 5`)
const s2 = sprites.create(img`3 3 3`)
const s3 = sprites.create(img`2 2 2`)
const s4 = sprites.create(img`a a a`)
const all = [s1, s2, s3, s4];
splitScreen.cameraFollowSprite(splitScreen.Camera.Camera1, s1)
splitScreen.cameraFollowSprite(splitScreen.Camera.Camera2, s2)
splitScreen.cameraFollowSprite(splitScreen.Camera.Camera3, s3)
// splitScreen.cameraFollowSprite(splitScreen.Camera.Camera4, s4)
let controllingIndex = 3;
updateControl();
controller.A.onEvent(ControllerButtonEvent.Pressed, () => {
updateControl();
})
function updateControl() {
controller.moveSprite(all[controllingIndex], 0, 0);
controllingIndex = (controllingIndex + 1) % 4;
controller.moveSprite(all[controllingIndex], 50, 50);
}