all repos — soulgrind @ d2a300b7e6fdb7f1d1ca39149da1bb431a788736

arcade-style rollerblading game in uxntal with xrxs multiplayer

making real progress on map generation
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmJvZ28ACgkQO3+8IhRO
Y5i0Aw//WT6BWxLCQJ+mqfzWYJHcfetQ3pQ/BZ3UNSgC3yKq4br1UMk3Y0igk6uZ
D8wYV23EKSXXXo0Y5ABr7aThA+xEOHiojwLl3DYEYtIWIaKO04yhcmiF/mydyQIT
5ouukxm8UhMarygYVjnVeRx0UveLW+pu2AjBptUkiboR1JPRgMNBNixAUn/VueGC
j1b5sNw4EML7Jh51cKG/WZOOV/SS3r4BW8iDFKIDUjUti7SOO1B4+I/cVzWdbPZ/
yR+nyS8s27llosngJ86bhJaMLRJdK38yaM2ygMOfR611fbYeWXnPoXWFmjTvSw8I
SZxMu78Rku1FOFZis1apwJq7x5N1qkC5K3DMX+Dd+f2AzSBq76iYvV80nL6ZAzqs
OGo/3UMxc46Un/EFFQ4I4J1ZfLQ/y5wfyvvtCYePKTQYQD+uH0H5E4TBCBlyWDwy
/QHe2SKpEKhQQAwcVzjMEe4bw1M+PB01FNmFIPgcOmJO0FhGzlfCufxQry1Mb4km
6Wthjtk5GnqKCX/1hLLnqXZuBE6BSVL6xgBpldZ8NJ26XTxEm2cIV7BcDtx8Kjln
SNCJhJBEWE2PAwHbtsXc8S5s3bDQBme+SGBIDXtCcteKl7t/Ey+g/xMTHsZBxKX3
x18GssaVQEV6jtna1fVMsPb7J9q5+bZ+FzkX6CByedMFCrbdu34=
=VJqZ
-----END PGP SIGNATURE-----
commit

d2a300b7e6fdb7f1d1ca39149da1bb431a788736

parent

b9fd7c8d46faffeaf14718d8780f74f798e1665c

1 files changed, 68 insertions(+), 10 deletions(-)

jump to
M soulgrind.talsoulgrind.tal

@@ -63,9 +63,22 @@

@map [ &edge $1 &tile-offset $1 - &row1 $40 - &row2 $40 - &row3 $40 +] + +@row1 [ + $40 + &mode $1 + &run $1 +] +@row2 [ + $40 + &mode $1 + &run $1 +] +@row3 [ + $40 + &mode $1 + &run $1 ] @rival [

@@ -213,7 +226,7 @@ #0010 ADD2 ,&while JMP &end POP2 POP2

( flash "press start" ) - .ticker LDZ INC + .ticker LDZk INC DUP .ticker STZ DUP #20 GTH ,&flash-text JCN

@@ -273,14 +286,59 @@ #01 .Screen/sprite DEO

RTN -@map-gen ( width -- ) +@check-run ( length -- invert ) - ( width is measured from the right edge. when initializing, we use #40; ) - ( when scrolling, we use left-shift passed from map-scroll ) - POP + #08 LTH ,&no JCN + ;prng JSR2 #7f GTH ,&no JCN + ( yes ) + #01 RTN + &no + #00 RTN +@invert-run ( row -- row ) + DUP #40 ADD LDZ #00 EQU ,&to-yes JCN + DUP #40 ADD #00 SWP STZ ,&to-reset JMP + &to-yes + DUP #40 ADD #01 SWP STZ + &to-reset + DUP #41 ADD #00 SWP STZ +RTN + +@set-tile ( width row -- width ) + + ( increase run ) + DUP #41 ADD LDZk INC SWP STZ + + ( get mode ) + DUP #41 ADD LDZ STH + + ( set at row edge - width ) + OVR .map/edge LDZ SWP SUB ADD STHr SWP STZ + +RTN + +@map-gen ( width -- ) + + ( width is measured from the right edge, + using the left-shift passed from map-scroll ) + + ( manage runs ) + #00 SWP &loop EQUk ,&done JCN + .row1/run LDZ ;check-run JSR2 #00 ,&row1-set JCN + .row1 ;invert-run JSR2 + &row1-set .row1 ;set-tile JSR2 + .row2/run LDZ ;check-run JSR2 #00 ,&row2-set JCN + .row2 ;invert-run + &row2-set .row2 ;set-tile JSR2 + .row3/run LDZ ;check-run #00 ,&row3-set JCN + .row3 ;invert-run JSR2 + &row3-set .row3 ;set-tile JSR2 + #01 SUB ,&loop JMP &done POP2 + +RTN + @map-scroll ( -> ) ( add dx to tile-offset )

@@ -297,9 +355,9 @@

( move map edge pointer ) ,&left-shift LDR .map/edge LDZ ADD - DUP LTH #40 ,&no-loop JCN + DUP LTH #40 ,&no-overflow JCN #40 SUB - &no-loop + &no-overflow .map/edge STZ