Starting game state

This commit is contained in:
Devine Lu Linvega 2023-05-22 10:31:19 -07:00
parent 6ca506f417
commit ef2dfe53eb
1 changed files with 104 additions and 11 deletions

View File

@ -25,16 +25,7 @@
( vectors )
;on-mouse .Mouse/vector DEO2
draw-border
#0008 .Screen/y DEO2
#0008 .Screen/x DEO2
draw-a
#0008 .Screen/x DEO2
#0038 .Screen/y DEO2
draw-w
#0008 .Screen/x DEO2
#0050 .Screen/y DEO2
draw-d
draw-blocks
BRK
@ -43,13 +34,64 @@ BRK
@on-mouse ( -> )
[ LIT2 00 -Mouse/state ] DEI NEQ #42 ADD ;cursor-icn update-cursor
[ LIT2 00 -Mouse/state ] DEI NEQ #42 ADD ;cursor-icn update-cursor
.Mouse/state DEI ?&on-touch
BRK
&on-touch ( -> )
.Mouse/x DEI2 #0008 SUB2 NIP #18 DIV
.Mouse/y DEI2 #0008 SUB2 NIP #18 DIV
move
#00 .Mouse/state DEO
BRK
@move ( x y -- )
phex #0a18 DEO
JMP2r
@game ( size, pos ) [
&a 0202 0000 =draw-a
&b 0201 0200 =draw-b
&v 0201 0201 =draw-v
&w 0101 0002 =draw-w
&x 0101 0102 =draw-x
&d 0102 0003 =draw-d
&y 0102 0103 =draw-y
&z 0201 0203 =draw-z
&c 0201 0204 =draw-c ]
(
@|drawing )
@draw-blocks ( -- )
#0900
&l
#00 OVR draw-block
INC GTHk ?&l
POP2
JMP2r
@draw-block ( id* -- )
#0006 MUL2 ;game ADD2
INC2 INC2 LDA2k to-screen
INC2 INC2 LDA2 JSR2
JMP2r
@to-screen ( x y -- )
#00 SWP #03 MUL #0008 ADD2 .Screen/y DEO2
#00 SWP #03 MUL #0008 ADD2 .Screen/x DEO2
JMP2r
@draw-a ( -- )
#56 .Screen/auto DEO
@ -58,6 +100,53 @@ BRK
JMP2r
@draw-c ( -- )
#56 .Screen/auto DEO
;blocks-chr/c .Screen/addr DEO2
#03 draw-times
JMP2r
@draw-z ( -- )
#56 .Screen/auto DEO
;blocks-chr/z .Screen/addr DEO2
#03 draw-times
JMP2r
@draw-y ( -- )
#56 .Screen/auto DEO
;blocks-chr/y .Screen/addr DEO2
#03 draw-times
JMP2r
@draw-x ( -- )
#56 .Screen/auto DEO
;blocks-chr/x .Screen/addr DEO2
#03 draw-times
JMP2r
@draw-v ( -- )
#56 .Screen/auto DEO
;blocks-chr/v .Screen/addr DEO2
#03 draw-times
JMP2r
@draw-b ( -- )
#56 .Screen/auto DEO
;blocks-chr/b .Screen/addr DEO2
#03 draw-times
JMP2r
@draw-d ( -- )
#26 .Screen/auto DEO
@ -136,6 +225,10 @@ JMP2r
.Screen/sprite DEO
JMP2r
(
@|stdlib )
@phex ( short* -- ) SWP phex/b &b DUP #04 SFT phex/c &c #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO JMP2r
(
@|assets )