Author Topic: Look what I found...  (Read 8254 times)

0 Members and 1 Guest are viewing this topic.

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Look what I found...
« on: January 24, 2007 »
I salvaged these from the EZboard archives (man its alot of work trawling through there).
Where possible I have included a quote from the author at the top of the code. These are raycasters and I would hate to see them disappear. I am still looking for the thread with rafriers raytracer its got reflections and shadows I gave up cos there is a lot of threads to go through. Someone help me fish out some of these jewels! -

I will add some more here as time goes on but this should get the ball rollin'. Please add in some that I missed out on I only searched for 3D so I missed out all the 2D stuff.

« Last Edit: January 28, 2007 by rain_storm »

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Look what I found...
« Reply #1 on: January 25, 2007 »
Nice find :)

I wonder what happened to Laurenz, he did some awesome stuff.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Look what I found...
« Reply #2 on: January 25, 2007 »
He is very good!
That has gotta be my favourite program for Yabasic simply because he went that extra mile and put sprites in the environment. He wasnt happy with how it worked out though that shows his high expectations. I dont agree with him I think its ace.

Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Look what I found...
« Reply #3 on: January 26, 2007 »
Xalthorn managed to get a pong game runnin in just 8 lines (31 lines actually but the aim was to have colons but not have any line longer than the emulator screen.) This has got to be the shortest game ever coded in yabasic.
I would give it a shot if only it wasn't Xalthorn's work, I wouldn't even come close.
Code: [Select]
open window 1,2:label s:x=310:y=246:p=4:q=4:label 1
if x<0 u=u+1:if x>640 t=t+1:if x<0 or x>640 goto s:x=x-p
c=peek("port1"):b=peek("port2"):setdispbuf d:d=1-d:y=y-q
setdrawbuf d:clear window:rect 630,n,610,n+80
text 40,20,str$(t):text 600,20,str$(u):rect 9,m,29,m+80
if c=64 m=m+5:if c=16 m=m-5:if b=64 n=n+5:if b=16 n=n-5
if x<39 and y<m+90 and y>m-10 p=-p:if y<9 or y>502 q=-q
if x>600 and y<n+90 and y>n-10 p=-p:circle x,y,10:goto 1

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Look what I found...
« Reply #4 on: January 26, 2007 »
There was a 25 line game comp which had a lot of entries.  I think I managed Space Invaders in 25 lines with only about 1 or 2 statements per line.
Here it is
Code: [Select]
'Alien Attack! Jim Shaw 14/1/2003
open window 640,512
xo=5:xi=3:yo=20:bx=-1:px=320:py=480
alive=16777215:level=5
repeat: setdispbuf d: d=1-d: setdrawbuf d: clear window
text 300,10,"Level:"+str$(((level-5))+1)
for y=0 to 2: for x=0 to 7
if and(alive,2^(x+y*8))<>0 then
xx=x*40+xo: yy=y*40+yo:fill rectangle xx,yy to xx+30,yy+30
fi: next x: next y: xo=xo+xi: p=peek("port1")
if and(p,160)<>0 then px=px-((and(p,160)-80)/24)
if px<0 px=0: if px>590 px=590: fi
fill rectangle px,py,px+50,py+8
if by=-1 and and(p,16384)<>0 then by=py: bx=px+25
elsif by<10 then by=-1: else
by=by-5:fill rectangle bx-2,by to bx+2,by-10
ax=int((bx-xo)/40):ay=int((by-yo)/40)
if ax>=0 and ax<8 and ay>=0 and ay<3 then
a=2^(ax+ay*8):if and(alive,a)<>0 then
alive=alive-a:by=-1
if alive=0 then  alive=16777215:xo=5:yo=20:level=level+1
if and(level,1)<>0 xi=abs(xi)+1
fi:fi:fi:fi
if xo>320 or xo<5 then xi=-xi:yo=yo+level
if yo>=370 end: fi:until (1=0)

Then we got this one from Tappi, which is IMHO the best game ever written for yabasic
Code: [Select]
open window 640,512:setrgb 0,80,80,80:dim x(8),y(8),c(8),d(8)
1 a=0:y=0:C=1:time=50:sp=1:sc=0
for b=0 to 1:restore 1:for x=220 to 420 step 60:a=a+1:y=y-82.5
x(a)=x : y(a)=y : c(a)=1+int(ran(4)):read d(a):next:next:data 32,128,64,16
repeat:setdrawbuf dw:dw=1-dw:setdispbuf dw:clear window:setrgb 1,100,100,200
text 320,300, "High Score: "+str$(hc),"cc":text 320,256, "Press any key to start","cc"
text 320,450, "Press the shown direction near the white rectangles!","cc"
until(peek("port1")<>0):repeat:time=time-.02
setdrawbuf dw:dw=1-dw:setdispbuf dw:clear window:k=peek("port1")
if y(C)-20>256 C=C+1:if C>8 C=1:if and(k,d(c(C)))>0 and P=0 and y(C)+20>206 then
d=10-abs(256-y(C)):if d>0 sc=sc+int(d):C=C+1: P=1:if C>8 C=1:endif
if k=0 P=0:for a=1 to 4:setrgb 1,250,250,250:rect x(a)-20,236,x(a)+20,276:next
text 20,20,"SCORE: "+str$(sc):sp=sp+.0006:text 20,40,"TIME: "+str$(int(time))
for a=1 to 8:y(a)=y(a)+sp:if y(a)>620 y(a)=-40:CR=abs(256-y(a))*.8
setrgb 1,CR,CR,250-CR:fill rect x(a)-20,y(a)-20,x(a)+20,y(a)+20
setrgb 1,0,0,0:rect x(a)-20,y(a)-20,x(a)+20,y(a)+20
setrgb 1,250-CR,50-CR,50-CR:if a=C setrgb 1,250,250,250
on c(a) goto 01,02,03,04
01 fill triangle x(a)-16,y(a)+16 to x(a)-16,y(a)-16 to x(a)+16,y(a):goto 00
02 fill triangle x(a)+16,y(a)+16 to x(a)+16,y(a)-16 to x(a)-16,y(a):goto 00
03 fill triangle x(a)+16,y(a)-16 to x(a)-16,y(a)-16 to x(a),y(a)+16:goto 00
04 fill triangle x(a)-16,y(a)+16 to x(a)+16,y(a)+16 to x(a),y(a)-16:goto 00
00 next:until(time<1):wait 1:if sc>hc hc=sc:goto 1
Link to the original thread
http://p205.ezboard.com/fyabasicprogrammingfrm4.showMessage?topicID=317.topic

There a raycaster that I did hanging around too, but it might be in blitz and it definitely uses the futile 'little steps' algorithm not the grid square one.

Jim
« Last Edit: January 27, 2007 by Jim »
Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Look what I found...
« Reply #5 on: January 27, 2007 »
You forget you put all this together Jim? http://members.iinet.net.au/~jimshaw/Yabasic/yabres/yabres.html


Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Look what I found...
« Reply #6 on: January 27, 2007 »
Parabellum's game was awesome :)

Code: [Select]
open window 640,512:window origin "cc":TEXT -30,10,"READY?":while(peek("port1")=0) i=ran() wend:dim C(1440),S(1440)
dim W(30):for i=0 to 1440 C(i)=cos(i/180*PI):S(i)=sin(i/180*PI) next:sA=90:A=12:dz=0.035:HP=100:gV=128:gD=20:hD=0.35
Z=16:for i=0 to 7:W(3*i)=Z:Z=Z-1.25:W(3*i+2)=int(ran(360/A)):W(3*i+1)=int(2.5+ran(9.5)):next:LABEL L:dz=dz+.0000075
HIT=1:rA=mod(rA+1,360):k=peek("port1"):if k=0 i=ran():if 0<>and(k,32) sA=mod(sA-1+356.5,360):if 0<>and(k,128) then
sA=mod(sA+1+3.5,360):fi:if k=16384 then sA=mod(sA+1,360) else sc=sc+dz fi:setrgb 1,0,0,0:setrgb 2,255,255,255
setrgb 3,255,255,255:for i=A to 360 step A:gtriangle 0,0 to 700*C(i+A),700*S(i+A) to 700*C(i),700*S(i):next:hV=hV-hD
if hV<-3 or hV>0 hD=-hD:x=272+hV:x1=(x-26+hV)*C(sA):y1=(x-26+hV)*S(sA):x2=x*C(sA+353):y2=x*S(sA+353):x3=x*C(sA+356.5)
y3=x*S(sA+356.5):x4=x*C(sA):y4=x*S(sA):x5=x*C(sA+3.5):y5=x*S(sA+3.5):x6=x*C(sA+7):y6=x*S(sA+7):setrgb 1,40,40,40
setrgb 2,70,70,70:setrgb 3,75,75,75:gtriangle x1,y1 to x4,y4 to x3,y3:gtriangle x1,y1 to x4,y4 to x5,y5
setrgb 2,80,80,80:gtriangle x1,y1 to x6,y6 to x5,y5:gtriangle x1,y1 to x2,y2 to x3,y3:J=I:sh=0:for j=1 to 8:gosub WALLS
J=mod(J+3,30):next:gosub SHIP:s$=str$(int(sc)):setrgb 1,0,0,0:text -309,-240,s$:text -310,-239,s$:setrgb 1,50,100,200
text -310,-240,s$:setrgb 1,170,170,250:fill rect 210,-248,210+HP,-236:clear rect 210,-248,310,-236:setdispbuf B:B=1-B
setdrawbuf B:clear window:if HIT=0 HP=HP-1.5:if HP<0 END:sc=sc+dz:GOTO L:LABEL WALLS:hit=1:Z=W(J):NB=W(J+1):FROM=W(J+2)
z=Z-dz:if z<2.60 and z>1.35 then DA=360-mod(rA+A*FROM,360):SA=mod(sA+DA,360):DA=mod(rA+(FROM+NB+2)*A+DA,360)
if SA>0 and SA<DA hit=0:fi:if z<1.35 gosub SHIP:W(J)=z:IF z<1 then I=mod(I+27,30):W(I)=11+z:W(I+1)=int(2.5+ran(9.5))
W(I+2)=int(ran(360/A)):FI:HIT=HIT*hit:LABEL WALL:r=700/Z:a1=rA+A*FROM:a2=rA+(FROM+NB+2)*A:x=r*C(a2):y=r*S(a2):a=a2-2*A
c=255/Z:ch=c*hit:setrgb 1,c,ch,ch:setrgb 2,c,ch,ch:for i=a1 to a step A
fill triangle r*C(i),r*S(i) to r*C(i+A),r*S(i+A) to x,y:next:Z=Z+1.25:rr=700/Z:c=255/Z:ch=c*hit:setrgb 3,c,ch,ch
gtriangle r*C(a1),r*S(a1) to x,y to rr*C(a1),rr*S(a1):setrgb 1,c,ch,ch
gtriangle rr*C(a2),rr*S(a2) to x,y to rr*C(a1),rr*S(a1):RETURN:LABEL SHIP:if sh=1 return:sh=1:gV=gV+gD
if gV>=255 or gV<=30 gD=-gD:x=242-hV:y=242-hV:setrgb 1,255,gV,0:setrgb 2,50,0,0:setrgb 3,50,0,0:c=C(sA):s=S(sA)
x1=(x+2)*C(sA+353):y1=(y+2)*S(sA+353):x2=(x+2)*C(sA+7):y2=(y+2)*S(sA+7):x3=(x-10)*c:y3=(y-10)*s:x4=(x+10)*c
y4=(y+10)*s:x5=(x-20)*c:y5=(y-20)*s:x=x*c:y=y*s:gtriangle x,y to x1,y1 to x3,y3:gtriangle x,y to x3,y3 to x2,y2
gtriangle x,y to x2,y2 to x4,y4:gtriangle x,y to x4,y4 to x1,y1:setrgb 1, 20, 20, 20:setrgb 2, 80, 80, 80
setrgb 3, 80, 80, 80:gtriangle x5,y5 to x1,y1 to x3,y3:gtriangle x5,y5 to x3,y3 to x2,y2:RETURN

By the way, Franck is still doing stuff... He is writing a Vectrex emulator in Java :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Look what I found...
« Reply #7 on: January 27, 2007 »
Thats one hell of a game from Parabellum, Thanks for hunting that one out Shocky. :goodpost:

Challenge Trophies Won:

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
Re: Look what I found...
« Reply #8 on: January 28, 2007 »
The first links in your first post rain_storm aren't working?
But, all these games are great!
Just wish I could program like this!!!
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Look what I found...
« Reply #9 on: January 28, 2007 »
I've removed the links and just put txt files in their place.

Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Look what I found...
« Reply #10 on: January 30, 2007 »
This just in ...

Code: [Select]
open window 1,1:u=16:v=64:t=507:w=640:z=620:g=20:q$="port2"
1 a=-1:b=-1:if(x<0)f=f+1:if(x>w)e=e+1:x=320:y=256:e$=str$(e)
2 r=r-and(q,u)/4+and(q,v)/u:l=l-and(p,u)/4+and(p,v)/u:x=x+a:y=y+b
if(y<5)or(y>t)b=-b:if(x<g)and(y>l)and(y<l+v)a=-a:p=peek("port1")
if(x>z)and(y>r)and(y<r+v)a=-a:if(x<0)or(x>w)goto 1:q=peek(q$)
text g,g,e$:text z,g,str$(f):box 0,l to g,l+v:box w,r to z,r+v
circle x,y,5:setdispbuf d:d=1-d:setdrawbuf d:clear window:goto 2

I got Pong down to 7 lines all squashed up and hard to read

also found these little treats-

jims sphere raytrace
rayfryers shere


Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Look what I found...
« Reply #11 on: January 30, 2007 »
That's cool :) I hadn't seen that one by Fryer before, I remember seeing a raytracer by him with a scene with a box on a reflective floor casting a shadow on the wall behind.

Surprising how small the listings are too considering what they are doing.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Yaloopy

  • Death From Above
  • DBF Aficionado
  • ******
  • Posts: 2876
  • Karma: 35
    • View Profile
    • UltraPaste
Fuck L. Ron Hubbard and fuck all his clones.
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Look what I found...
« Reply #13 on: February 04, 2007 »
Thats a good one that rayfyer is one hell of a programmer

Challenge Trophies Won: