Nice. I'll try to put it in. I'm a bit busy the next couple of days but I'll do it as soon as I can. I did some quick estimation and I think it will save about 50 characters more than my version which is enough to fit all features .
I went ahead and integrated your change. Its in no way optimized but it shows
that it works at least (The old sprite code is still in there for example). There are
some other optimizations I did yesterday that also should get in there for
example I changed the ending so that the finish is always on a straight road. I
also made the character pattern generation a bit more efficient. It will probably
take a day to integrate everything so I'll keep you posted. Anyways, here is a
working version with the new road generation:
1 DEFINTA-Y:V=14:S$(O1)="A18A0CA0FB07C03C01H00A80AE0AF0AFCIFFH00A80AE0AF0AF8AFCBFEAFFP00F3FF7FTFFAF0AF8AFCAFELFFE00A80AC0AE0BF0AF8AFCBFEBFFP00B01B03B07B0FB1FB3FB7FBFFB80BC0BE0BF0BF8BFCBFEBFFP00B01B03B07B0FB1FB3FB7FbFFB80BC0BE0BF0BF8BFCBFE" 2 COLOR15,5,1:X=V:S$(1)="BFFX00A01A07A0FA1FA3FB7FAFFC00A01A07A0FA3FIFFA18A30AF0BE0CC0C80J00A01A03A07B0FA1FA3FB7FBFFA0FA1FA3FA7F\FFFFCFFEDFFG00A1FA20A40A7FBCFA7FB70G00AC0A20A10AF0B98AF0B70J00A0FA10A1FA2FA1FA19K00B80A40B80L00A06A0FA09_00A03" 3 SCREEN2,3,0:FORX=0TO2:FORY=0TO31:R=16-Y\2:LINE(R-(X-1)*((SIN(Y^.8/6)-(Y<16))*6-R-2)+(X<2),X*32+Y)-STEP(Y+1,0),15:NEXTY,X:FORI=0TO383:VPOKE14336+I,VPEEK((IAND7)+(IAND8)*32+(IAND48)\2+(IAND448)*8):NEXT:SCREEN1 4 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEKEYOFF:LOCATE8,1:PRINT"PLEASE WAIT!":FORI=256TO1023:VPOKE7952+I,85:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:SOUND3,V: 5 A=32*12: FORW=0TO1:FORO=1TO212STEP3:Q=ASC(MID$(S$(W),O,1))-65:Y=VAL("&H"+MID$(S$(W),O+1,2)):N=14336:IFNOT(W=1ANDO>114)THEN 6 ELSE FORA=ATOA+Q:VPOKEA+N,Y:NEXT 6 NEXT:PUTSPRITE8+W,(80+64*W,159),V,6+W:NEXT:ONERRORGOTO4:FORR=1TO12:FORH=0TO31:VPOKE6496+H+R*32,(R<9ORH0:D=D*D\96:U=STICK(0):*:PRINTUSING"SPEED:###kmh RANK:###";S*10;N\128-82:NEXT:Z$=SPACE$(V):S=15:Z=TIME\(6-PEEK(43)\128) 13 FORN=0TO244:D=88-3*N:U=Y*(N\6-V):Y=D>0:SOUND8,U:SOUND9,U:D/2:PUTSPRITE0,(116-(D<58)*((21-D*D\96)*B+F*10)+(X-36)*D\126,-Y*(98+D)-31),1,15+Y*D\24:LOCATE6,4:PRINTMID$(Z$+"Race Over Time ="+STR$(Z/10)+"s"+Z$,NMOD42+1,S):NEXTI:NEXT:SCREENUP
I couldn't wait to finish it up So here is the Rally-X entry with all features including scrolling mountains, faiding audio, the little line in the horizon and
everything is within the size limits. I'll test it some more later today.
Here is the final code (we've said that a couple of times now :
1 J=S-J*(J<96-S):K=J\16:FORW=0TO2:VPOKE8208+W,P(W+K):NEXT:IFTTHENRESUMENEXTELSEONERRORGOTO1:DEFINTA-Y:COLOR15,5,1:V=14:SCREEN2,3,0:FORX=0TO2:FORY=0TO31:R=16-Y\2:LINE(R-(X-1)*((SIN(Y^.8/6)-(Y<16))*6-R-2)+(X<2),X*32+Y)-STEP(Y+1,0),15:NEXTY,X 2 N=14336:FORI=0TO383:VPOKEN+I,VPEEK((IAND7)+(IAND8)*32+(IAND48)\2+(IAND448)*8):NEXT:SCREEN1:S$="G00A1FA20A40A7FBCFA7FB70G00AC0A20A10AF0B98AF0B70J00A0FA10A1FA2FA1FA19K00B80A40B80L00A06A0FA09_00A03":KEYOFF:LOCATE8,1:PRINT"PLEASE WAIT!":X=V: 3 FORO=1TO98STEP3:Q=ASC(MID$(S$,O,1))-65:Y=VAL("&H"+MID$(S$,O+1,2)):FORI=ITOI+Q:VPOKEI+N,Y:NEXT:NEXT:R=N\2:FORI=256TO1023:VPOKE7952+I,85:O=VPEEK(I):VPOKEI,(OORO\2)\(2-(IAND4)\4):NEXT:FORI=ITO1279:VPOKE6464+(IAND63),224+8*(IAND3)-(IAND32):' 4 W=2^(IAND7):J=127\W:VPOKEI+512,JAND-W:VPOKEI+768,JOR-WAND255:J=8-(IAND32)\8:VPOKEI,(JANDI)*255\J:NEXT:FORK=1TO12:FORH=0TO31:VPOKE6496+H+K*32,(K<9ORH0:NEXTI:D=D*D\96:PRINTUSING"SPEED:##0kmh RANK:###";S;N\128-82:-:F=B:IFC<TTHENC=V+T+TMOD99:B=(R-T>99)*(1-CMOD3) 6 S=S-(S<18ANDSTRIG(0))*2+(S>0):-:FORW=3TO4:PUTSPRITEW+1,(F*10+W*H,95),V,4*B+W+1:PUTSPRITE3+W,(W*H,127),V,4*F+3+W:NEXT:-:T=T+S-1:PUTSPRITE1,(115-(D<34)*((24-D)*B+F*10)+(E-64)*D\225,-Y*(98+D)-31),-6*(T 0)*(N\4-V):SOUND8,U:SOUND9,U:PUTSPRITE0,(116-(36-X)*D\126,68+D),-(D>0),S-D\24:LOCATE6,4:PRINTMID$(Z$+"Race Over Time ="+STR$(Z/10)+"s"+Z$,NMOD42+1,S):-:NEXT:SCREEN BY' dvik & NYYRIKKI
W0000T!
I just played it and euhm.. well... this is insane! If you have one or two chars left, how about adding a hi/lo gear (Hyper Rally style) for the mega-finishing touch?
Darn.. a complete racing game in 1524 bytes (saved tokenized). Konami eat your heart out. Anyone eat your heart out, really
pretty freaky 283.3 seconds .. I wonder what other games (except Tetris, seen in in MCCM already) can be done in such few lines at reasonable speed..
If you need more ideas: how about hills? Or day/night/snow, like in the IOCCC?
Don't get me wrong: the program is freakin' brilliant!
This one has 'rank' which the ioccc one doesn't. I'm not sure it compensates for hills, snow etc though
Nice... so, what we'll implement next... I know there are few loose bytes (like line color) in road genarator
What about white chars behind the road, and holes in the sprite to suggest moving road-stripes? animating perhaps ^_^ .. so multiple roadsprites..