forked from microsoft/tilecode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugger.ts
57 lines (44 loc) · 1.59 KB
/
debugger.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Add your code here
// debugger for a rule
// - use neighborhood to generate a tile map
namespace tileworld {
// - attaches to VM
// - shows state of sprites (old arrows; new arrows)
// - the three phases: moving, resting, colliding
// - allows user to select a sprite and see enabled rules (or debugger will choose)
// - allows the user to choose which rule goes next (step)
export class Debugger extends RuleVisualsBase {
constructor(p: Project) {
super(p);
this.setCol(0); this.setRow(0);
controller.A.onEvent(ControllerButtonEvent.Pressed, () => {
});
controller.B.onEvent(ControllerButtonEvent.Pressed, () => {
game.popScene();
});
}
protected update() {
screen.fill(0);
screen.fillRect(0, yoff, 16, 16, 11);
screen.drawTransparentImage(debug, 0, yoff);
screen.print("debugger not available", 16, 32 + yoff + 6);
}
}
export class UnitTest {
private map: Image;
constructor(private p: Project, private rid:number) {
// for starters, we'll just keep things local
this.map = image.create(10,7);
}
public makeTest() {
// generate satisfying assignment to tiles
// run the VM
}
private generateSATassignment() {
// given the rule and constraints, create tile map
}
}
export class InteractionTest {
// explore interactions between two (or more) rules
}
}