~rabbits/donsol

066e194acfc373af9d48373cfdc113a0dc61de9d — neauoire 4 months ago b635e86
Fixed issue with mouse in menu
1 files changed, 82 insertions(+), 75 deletions(-)

M src/donsol.tal
M src/donsol.tal => src/donsol.tal +82 -75
@@ 9,21 9,24 @@

|0000

@mode $1
@score $1
@deck
	&length $1 &cards $36
@table
	&a $1 &b $1 &c $1 &d $1 &selection $1 &timer $1
@cursor
	&x $2 &y $2 &last $1
@frame
	&x $2 &y $2 &x2 $2 &y2 $2
@player
	&hp $1 &hp-tween $1
	&sp $1 &sp-tween $1
	&dp $1 &xp $1
	&ran $1 &sick $1
	@mode $1
	@score $1
	@deck
		&length $1 &cards $36
	@table
		&a $1 &b $1 &c $1 &d $1 &selection $1 &timer $1
	@cursor
		&x $2 &y $2 &last $1
	@frame
		&x $2 &y $2 &x2 $2 &y2 $2
	@player
		&hp $1 &hp-tween $1
		&sp $1 &sp-tween $1
		&dp $1 &xp $1
		&ran $1 &sick $1

(
@|vectors )

|0100 ( -> )



@@ 112,7 115,9 @@ BRK
		POP
	&skip
	.Mouse/state DEI #00 EQU ,&no-click JCN
		;go-game JSR2 BRK
		#00 .Mouse/state DEO
		;go-game JSR2
		BRK
		&no-click

BRK


@@ 123,64 128,6 @@ BRK

BRK

@draw-menu ( -- )

	( draw castle )
	#0320 #0000
	&loop
		( x ) DUP2 #0020 ( mod ) DIV2k MUL2 SUB2 #30 SFT2 .frame/x LDZ2 ADD2 #0010 SUB2 .Screen/x DEO2
		( y ) DUP2 #35 SFT2 .frame/y LDZ2 ADD2 #0040 SUB2 .Screen/y DEO2
		( addr ) DUP2 ;splash-table ADD2 LDA #40 SUB #00 SWP #40 SFT2 ;spritesheet ADD2 .Screen/addr DEO2
		( draw ) #81 .Screen/sprite DEO
		INC2 GTH2k ,&loop JCN
	POP2 POP2

	( draw score )
	.frame/x LDZ2 #0068 ADD2
	.frame/y LDZ2 #0008 SUB2
	.score LDZ #02
		;draw-value JSR2

	&options
	
	.frame/x LDZ2 .frame/y LDZ2
		( easy )
		OVR2 #0028 ADD2
		OVR2 #0078 ADD2
			#0010 ADD2 ;easy-txt #02 [ .mode LDZ #00 EQU ADD ] ;draw-label JSR2
		.Screen/x DEI2 #002c SUB2 .Screen/x DEO2
		;cursor-hor-icn .Screen/addr DEO2
		#01 [ .mode LDZ #00 EQU MUL ] .Screen/sprite DEO
		( normal )
		OVR2 #0058 ADD2
		OVR2 #0078 ADD2
			#0010 ADD2 ;normal-txt #02 [ .mode LDZ #01 EQU ADD ] ;draw-label JSR2
		.Screen/x DEI2 #003c SUB2 .Screen/x DEO2
		;cursor-hor-icn .Screen/addr DEO2
		#01 [ .mode LDZ #01 EQU MUL ] .Screen/sprite DEO
		( hard )
		OVR2 #0098 ADD2
		OVR2 #0078 ADD2
			#0010 ADD2 ;hard-txt #02 [ .mode LDZ #02 EQU ADD ] ;draw-label JSR2
		.Screen/x DEI2 #002c SUB2 .Screen/x DEO2
		;cursor-hor-icn .Screen/addr DEO2
		#01 [ .mode LDZ #02 EQU MUL ] .Screen/sprite DEO
	POP2 POP2

JMP2r

( game )

@go-game ( -- )

	;on-button-game   .Controller/vector DEO2
	;on-mouse-game    .Mouse/vector DEO2
	;on-frame-game    .Screen/vector DEO2

	;start-game JSR2

JMP2r

@on-frame-game ( -> )

	( table timer )


@@ 288,7 235,18 @@ BRK

BRK

( core )
(
@|core )

@go-game ( -- )

	;on-button-game .Controller/vector DEO2
	;on-mouse-game .Mouse/vector DEO2
	;on-frame-game .Screen/vector DEO2

	;start-game JSR2

JMP2r

@start-game ( -- )



@@ 627,6 585,9 @@ JMP2r

JMP2r

(
@|drawing )

@redraw ( -- )

	;draw-status JSR2


@@ 636,6 597,52 @@ JMP2r

JMP2r

@draw-menu ( -- )

	( draw castle )
	#0320 #0000
	&loop
		( x ) DUP2 #0020 ( mod ) DIV2k MUL2 SUB2 #30 SFT2 .frame/x LDZ2 ADD2 #0010 SUB2 .Screen/x DEO2
		( y ) DUP2 #35 SFT2 .frame/y LDZ2 ADD2 #0040 SUB2 .Screen/y DEO2
		( addr ) DUP2 ;splash-table ADD2 LDA #40 SUB #00 SWP #40 SFT2 ;spritesheet ADD2 .Screen/addr DEO2
		( draw ) #81 .Screen/sprite DEO
		INC2 GTH2k ,&loop JCN
	POP2 POP2

	( draw score )
	.frame/x LDZ2 #0068 ADD2
	.frame/y LDZ2 #0008 SUB2
	.score LDZ #02
		;draw-value JSR2

	&options
	
	.frame/x LDZ2 .frame/y LDZ2
		( easy )
		OVR2 #0028 ADD2
		OVR2 #0078 ADD2
			#0010 ADD2 ;easy-txt #02 [ .mode LDZ #00 EQU ADD ] ;draw-label JSR2
		.Screen/x DEI2 #002c SUB2 .Screen/x DEO2
		;cursor-hor-icn .Screen/addr DEO2
		#01 [ .mode LDZ #00 EQU MUL ] .Screen/sprite DEO
		( normal )
		OVR2 #0058 ADD2
		OVR2 #0078 ADD2
			#0010 ADD2 ;normal-txt #02 [ .mode LDZ #01 EQU ADD ] ;draw-label JSR2
		.Screen/x DEI2 #003c SUB2 .Screen/x DEO2
		;cursor-hor-icn .Screen/addr DEO2
		#01 [ .mode LDZ #01 EQU MUL ] .Screen/sprite DEO
		( hard )
		OVR2 #0098 ADD2
		OVR2 #0078 ADD2
			#0010 ADD2 ;hard-txt #02 [ .mode LDZ #02 EQU ADD ] ;draw-label JSR2
		.Screen/x DEI2 #002c SUB2 .Screen/x DEO2
		;cursor-hor-icn .Screen/addr DEO2
		#01 [ .mode LDZ #02 EQU MUL ] .Screen/sprite DEO
	POP2 POP2

JMP2r

@draw-dialog ( dialog* -- )

	STH2