dense, short, & fast

This is my simple sample wallcaster in condensed form and with cheat speed.

I know it's silly but it epitomizes my style

DEFLNG A-Z: READ numw, npost: REDIM rxw(npost) AS LONG, rzw(npost) AS LONG
DIM mk(127), tim AS SINGLE, wiz!(319), fbuf(319), oldw(319), oh(319)
SCREEN 13: pi! = ATN(1) * 4: FOR x = 0 TO 319: oh(x) = 191: NEXT: cpsi! = 1
REDIM pstx(npost), pstz(npost), wcol(numw), w1(numw), w2(numw)
nactwp = 18: nactw = 16: FOR p = 1 TO nactwp: READ pstx(p), pstz(p): NEXT
FOR w = 1 TO nactw: READ w1(w), w2(w), wcol(w): NEXT: 'L4-NO0.BAS by kinem
nactwp = nactwp + 1400: nactw = nactw + 1200: reg = -1: px = 512: pz = 512
FOR x = 0 TO 9: FOR z = 0 TO 9: reg = reg + 1: pr = reg * 14: FOR p = 5 TO 19
pp = p + pr: pstx(pp) = pstx(p) + 2560 * x: pstz(pp) = pstz(p) + 2560 * z
NEXT: FOR w = 5 TO 16: ww = w + reg * 12: w1(ww) = w1(w) + pr
w2(ww) = w2(w) + pr: wcol(ww) = (wcol(w) + reg) MOD 255: NEXT: NEXT: NEXT
DO: rpx = px * cpsi! - pz * spsi!: rpz = px * spsi! + pz * cpsi!
FOR p = 1 TO nactwp: rxw(p) = pstx(p) * cpsi! - pstz(p) * spsi! - rpx
rzw(p) = pstx(p) * spsi! + pstz(p) * cpsi! - rpz: NEXT: FOR wall = 1 TO nactw
rz1 = rzw(w1(wall)): rz2 = rzw(w2(wall)): rz21 = rz2 - rz1: rx1 = rxw(w1(wall))
rx2 = rxw(w2(wall)): rx21 = rx2 - rx1: dn = rx21 * rz1 - rz21 * rx1
IF dn > 0 AND (rz1 > 0 OR rz2 > 0) THEN
IF rz1 > 0 THEN ll = 160 + (250 * rx1) / rz1 ELSE ll = 0
IF rz2 > 0 THEN ul = 160 + (250 * rx2) / rz2 ELSE ul = 320
IF ll > ul THEN SWAP ll, ul
ll = ll * -(ll >= 0): IF ul > 320 THEN ul = 320
dwdsx! = -rz21 / dn: iZ! = (250 * rx21 + rz21 * 160 - rz21 * ll) / dn
FOR sx = ll TO ul - 1: IF iZ! > wiz!(sx) THEN wiz!(sx) = iZ!: fbuf(sx) = wall
iZ! = iZ! + dwdsx!: NEXT
END IF: NEXT: FOR x = 0 TO 319: wc = wcol(fbuf(x))
IF wiz!(x) IF wc oldw(x) THEN LINE (x, 199 - ymax)-(x, ymax), wc
IF wc = oldw(x) AND ymax > oh(x) THEN
LINE (x, 199 - ymax)-(x, 199 - oh(x)), wc: LINE (x, oh(x))-(x, ymax), wc
END IF
IF ymax LINE (x, 199 - oh(x))-(x, 199 - ymax - 1), 8: LINE (x, oh(x))-(x, ymax + 1), 6
END IF: oldw(x) = wc: oh(x) = ymax: NEXT: ERASE wiz!: fram = fram + 1
IF TIMER > tim THEN
tim = TIMER + 1: ofram = fram: fram = 0: LOCATE 1, 30: PRINT ofram; "fps "
END IF: i = INP(96): i\$ = INKEY\$: IF i = 224 OR i = 42 THEN i = oi ELSE oi = i
fb = (i = 80) - (i = 72): px = px + 60 * spsi! * fb: pz = pz + 60 * cpsi! * fb
pa = (pa + 25 * ((i = 75) - (i = 77)) + 1800) MOD 1800: psi! = pa * pi! / 900
cpsi! = COS(psi!): IF px 27400 THEN px = 27400
spsi! = SIN(psi!): IF pz 27400 THEN pz = 27400
LOOP UNTIL i = 1: DATA 1216,1418,0,0,0,27600,27600,27600,27600,0,0,2528
DATA 1100,2528,1100,2560,0,2560,1360,2560,2560,2560,2560,700,2528,700,2528
DATA 1280,1360,2528,2560,400,2560,0,2528,400,2016,0,1,2,1,2,3,2,3,4,3,4,1,4,5
DATA 6,186,6,7,56,7,8,186,10,9,114,11,10,9,12,11,10,13,12,11,14,13,12,9,14,13
DATA 16,15,20,15,17,21,17,18,22

Posted on May 20, 2012, 9:49 PM

 Response Title Author and Date trying again to post the code kinem on May 20, 10:12 PM * Uncheck the formatted text box below post area Clippy on May 21, 9:02 AM Thanks kinem on May 21, 7:32 PM