diff options
author | Yuchen Pei <me@ypei.me> | 2018-01-08 16:22:46 +0100 |
---|---|---|
committer | Yuchen Pei <me@ypei.me> | 2018-01-08 16:22:46 +0100 |
commit | a356d68c1c314cddbd987616f12291fc24bebf37 (patch) | |
tree | 4562ca61a2e7fcf7dd5de76b94dc68bfe3c71cd8 /projects/09/K/KGame.vm | |
parent | 7e4cd1bac23f7cc02d0f14bcc6ef00357377fc2a (diff) |
project 9 checkpoint
- no more compiler error
- but still some bugs:
- tiles get stuck
- segment error (possibly due to deep copy?)
Diffstat (limited to 'projects/09/K/KGame.vm')
-rw-r--r-- | projects/09/K/KGame.vm | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/projects/09/K/KGame.vm b/projects/09/K/KGame.vm new file mode 100644 index 0000000..767c14a --- /dev/null +++ b/projects/09/K/KGame.vm @@ -0,0 +1,74 @@ +function KGame.new 0 +push constant 1 +call Memory.alloc 1 +pop pointer 0 +call Board.new 0 +pop this 0 +push this 0 +call Board.draw 1 +pop temp 0 +push pointer 0 +return +function KGame.dispose 0 +push argument 0 +pop pointer 0 +push this 0 +call Board.dispose 1 +pop temp 0 +push pointer 0 +call Memory.deAlloc 1 +pop temp 0 +push constant 0 +return +function KGame.run 3 +push argument 0 +pop pointer 0 +push constant 0 +pop local 0 +push constant 0 +pop local 2 +label WHILE_EXP0 +push local 2 +not +not +if-goto WHILE_END0 +label WHILE_EXP1 +push local 0 +push constant 130 +lt +push local 0 +push constant 133 +gt +or +not +if-goto WHILE_END1 +call Keyboard.keyPressed 0 +pop local 0 +goto WHILE_EXP1 +label WHILE_END1 +push local 0 +push constant 130 +sub +pop local 1 +label WHILE_EXP2 +push local 0 +push constant 0 +eq +not +not +if-goto WHILE_END2 +call Keyboard.keyPressed 0 +pop local 0 +goto WHILE_EXP2 +label WHILE_END2 +push this 0 +push local 1 +call Board.next 2 +pop temp 0 +push this 0 +call Board.draw 1 +pop temp 0 +goto WHILE_EXP0 +label WHILE_END0 +push constant 0 +return |