| ... | ... |
@@ -9,7 +9,6 @@ |
| 9 | 9 |
@timer $1 |
| 10 | 10 |
@frame $1 |
| 11 | 11 |
@direction $1 |
| 12 |
- |
|
| 13 | 12 |
( |
| 14 | 13 |
@|vectors ) |
| 15 | 14 |
|
| ... | ... |
@@ -29,7 +28,7 @@ |
| 29 | 28 |
#0020 .ball/x STZ2 |
| 30 | 29 |
#0020 .ball/y STZ2 |
| 31 | 30 |
( initial velocity ) |
| 32 |
- #0008 .ball/vx STZ2 |
|
| 31 |
+ #0003 .ball/vx STZ2 |
|
| 33 | 32 |
#0000 .ball/vy STZ2 |
| 34 | 33 |
( once ) |
| 35 | 34 |
make-shadow |
| ... | ... |
@@ -39,10 +38,6 @@ BRK |
| 39 | 38 |
|
| 40 | 39 |
@on-frame ( -> ) |
| 41 | 40 |
|
| 42 |
- ( every 4th frame ) |
|
| 43 |
- .timer LDZ INC .timer STZk POP #03 EQU JMP [ BRK ] |
|
| 44 |
- ( reset timer ) |
|
| 45 |
- [ LIT2 00 -timer ] STZ |
|
| 46 | 41 |
( 12 frames animation ) |
| 47 | 42 |
.frame LDZk .direction LDZ ADD #0c DIVk MUL SUB SWP STZ |
| 48 | 43 |
move-ball |
| ... | ... |
@@ -54,11 +49,12 @@ BRK |
| 54 | 49 |
|
| 55 | 50 |
@flip-direction ( zp^ -- ) |
| 56 | 51 |
|
| 57 |
- LDZ2k #ffff EOR2 ( INC2 ) ROT STZ2 |
|
| 52 |
+ LDZ2k #ffff EOR2 INC2 ROT STZ2 |
|
| 58 | 53 |
.direction LDZk #0a EOR SWP STZ |
| 59 | 54 |
|
| 60 | 55 |
JMP2r |
| 61 | 56 |
|
| 57 |
+ |
|
| 62 | 58 |
@check-flip-vx ( x -- x ) |
| 63 | 59 |
|
| 64 | 60 |
( left ) DUP2 #0010 LTH2 ?&flip |
| ... | ... |
@@ -89,8 +85,14 @@ JMP2r |
| 89 | 85 |
POP |
| 90 | 86 |
.ball/vx LDZ2k STH2k ROT STZ2 |
| 91 | 87 |
.ball/x LDZ2k STH2r ADD2 check-flip-vx ROT STZ2 |
| 92 |
- .ball/vy LDZ2k INC2 STH2k ROT STZ2 |
|
| 93 |
- .ball/y LDZ2k STH2r ADD2 check-flip-vy ROT STZ2 |
|
| 88 |
+ |
|
| 89 |
+ .timer LDZ INC .timer STZ |
|
| 90 |
+ .timer LDZ #05 EQU ?&pull !&pass |
|
| 91 |
+ |
|
| 92 |
+ &pull #00 .timer STZ .ball/vy LDZ2k INC2 STH2k ROT STZ2 !&end |
|
| 93 |
+ &pass .ball/vy LDZ2k STH2k ROT STZ2 !&end |
|
| 94 |
+ |
|
| 95 |
+ &end .ball/y LDZ2k STH2r ADD2 check-flip-vy ROT STZ2 |
|
| 94 | 96 |
|
| 95 | 97 |
@draw-ball ( -- ) |
| 96 | 98 |
|