~rabbits/markl

12ed84858d64825c017053e2f5093f3ebd2d3f07 — Devine Lu Linvega 2 months ago 3b571b4
Starting door event
5 files changed, 71 insertions(+), 13 deletions(-)

M etc/npc10x10.chr
M src/assets.tal
M src/events.tal
M src/markl.tal
M src/world.tal
M etc/npc10x10.chr => etc/npc10x10.chr +0 -0
M src/assets.tal => src/assets.tal +34 -0
@@ 342,6 342,40 @@
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0000 0000 0000 0000 0000 0000 ]

@door-chr [
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0738 6080 0000 0000 0007 1f7f
	0000 0000 e01c 0601 0000 0000 00e0 f8fe
	0000 0000 0000 0000 0000 0000 0000 0000
	0101 0302 0204 0404 0000 0001 0103 0303
	0000 0700 1000 6040 ffff f8f8 e0e0 8080
	0000 e000 0800 0602 ffff 1f1f 0707 0101
	8080 c040 4020 2020 0000 0080 80c0 c0c0
	040c 0808 0808 0808 0303 0707 0707 0707
	4040 4040 4060 4040 8080 8080 8080 8080
	0202 0202 0206 0202 0101 0101 0101 0101
	2030 1010 1010 1010 c0c0 e0e0 e0e0 e0e0
	0808 0808 0808 0808 0707 0707 0707 0707
	4040 6040 4040 4040 8080 8080 8080 8080
	0202 0602 0202 0202 0101 0101 0101 0101
	1010 1010 1010 1010 e0e0 e0e0 e0e0 e0e0
	0808 0808 0808 0810 0707 0707 0707 070f
	4040 4040 4040 6020 8080 8000 8080 80c0
	0202 0202 0202 0604 0101 0100 0101 0103
	1010 1010 1010 1008 e0e0 e0e0 e0e0 e0f0
	1010 1010 1010 1010 0f0f 0f0f 0f0f 0f0f
	2020 201f 0000 0000 c0c0 c0e0 ffff ffef
	0404 04f8 0000 0000 0303 0307 ffff fff7
	0808 0808 0808 0808 f0f0 f0f0 f0f0 f0f0
	1010 101f 1000 0000 0b0f 0700 0000 0000
	0000 03fc 0000 0000 ffff fc00 0000 0000
	0000 c03f 0000 0000 ffff 3f00 0000 0000
	0808 08f8 0800 0000 d0f0 e000 0000 0000 ]

(
@|player )


M src/events.tal => src/events.tal +17 -10
@@ 1,36 1,43 @@
( Events Collection )

@event-goat =&on-sight =&on-collision =npc-spell-chr
	&on-sight ( self* -- )
@event-goat =&on-draw =&on-collision =npc-spell-chr
	&on-draw ( self* -- )
	POP2 JMP2r

	&on-collision ( self* -- fail )
	( spell* ) #0004 ADD2 LDA2 <animate-unlock-spell>
	#01 JMP2r

@event-block =&on-sight =&on-collision =blocker-chr
	&on-sight ( self* -- )
@event-block =&on-draw =&on-collision =blocker-chr
	&on-draw ( self* -- )
	POP2 JMP2r

	&on-collision ( self* -- fail )
	POP2
	#01 JMP2r
	POP2 #01 JMP2r

@event-nimp =&on-sight =&on-collision =npc-size-chr
	&on-sight ( self* -- )
@event-nimp =&on-draw =&on-collision =npc-size-chr
	&on-draw ( self* -- )
	POP2 JMP2r

	&on-collision ( self* -- fail )
	( slot* ) #0004 ADD2 LDA2 <animate-unlock-size>
	#01 JMP2r

@event-warp =&on-sight =&on-collision =warp-chr
	&on-sight ( self* -- )
@event-warp =&on-draw =&on-collision =warp-chr
	&on-draw ( self* -- )
	POP2 JMP2r

	&on-collision ( self* -- fail )
	<animate-warp>
	#00 JMP2r

@event-door =&on-draw =&on-collision =door-chr
	&on-draw ( self* -- )
	POP2 JMP2r

	&on-collision ( self* -- fail )
	<animate-door>
	#00 JMP2r

~src/spells.tal


M src/markl.tal => src/markl.tal +17 -1
@@ 175,7 175,7 @@
	#0100 .program/size STZ2
	<unlock-all>
	( | room )
	#0106 ;w1-1-stage !<enter-room>
	#0203 ;w1-1-stage !<enter-room>

@<enter-room> ( x y room* -- )
	DUP2 <copy-room>


@@ 431,6 431,22 @@
	;player-idle-chr <set-state>
	[ LIT2 &pos $2 ] [ LIT2 &room $2 ] !<enter-room>

@<animate-door> ( warp* -- )
	#0004 ADD2 LDA2k ,&room STR2
	INC2 INC2 LDA2 ,&pos STR2
	;&delay !<set-post-turn>

	&delay ( -- )
	#e0 ;&animation !<animate-delay>

	&animation ( -- )
	;player-jump-chr <set-state>
	.player/posy LDZ2 #0030 SUB2 #0001 ;&callback !<animate-player-posy>

	&callback ( -- )
	;player-idle-chr <set-state>
	[ LIT2 &pos $2 ] [ LIT2 &room $2 ] !<enter-room>

@<animate-delay> ( timer callback* -- )
	,&callback STR2
	,&timer STR

M src/world.tal => src/world.tal +3 -2
@@ 82,9 82,10 @@
	( ) [ 01 01 01 00 00 00 01 06 ]
	( ) [ 01 0a 01 02 00 01 02 00 ]
	( ) [ 01 01 01 00 00 00 00 00 ]
	( ) &events 02
	( ) &events 03
	( ) [ 0106 =event-warp =lobby-stage 0606 ]
	( ) [ 0006 =event-goat =jump-right $2 ] &end
	( ) [ 0006 =event-goat =jump-right $2 ] 
	( ) [ 0200 =event-door =lobby-stage 0606 ] &end

@w1-bridge [ 0808 =&events =&tiles =&end ]
	&tiles ( )