Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Blitz => Topic started by: nawitus on September 26, 2006

Title: Pong in 6 lines[BB2D]
Post by: nawitus on September 26, 2006
Code: [Select]
SetBuffer BackBuffer()q=200:p=135:e=q:r=p:o=9:b=100:.k:If(e<0)n=n+1:e=q:o=80-Rnd(99):r=p
e=e+7*Cos(o):r=r+7*Sin(o):l=MouseY():If(e>400)m=m+1:e=q:r=p:o=80+Rnd(99)
If(r<9)+(r>290)o=360-o
If((e<15)+(l-r>-21)+(r>l-35)=3)+((e>375)+(b-r>-46)+(r>b-9)=3)o=180-o
b=b+1:If(b>r)b=b-2
Rect 1,l-25,9,50:Rect 390,b,9,50:Oval e,r,9,9:AppTitle m+"-"+n:Flip:Cls:Goto k

I don't think it can be fitted to any less characters very easily  ;D
Title: Re: Pong in 6 lines
Post by: Rbz on September 27, 2006
Very nice  :)
Title: Re: Pong in 6 lines
Post by: Tetra on September 27, 2006
hehe cool, that would have gone well with the 20line code challenge.

I still got a pong machine somewhere  :||

just a thought, when the ball gets closer to either side from the center of the paddle, you should add a slight vertical deflection, the reason for this is that the paddle was stopped in the middle and the ball just went back and forth for ever ;D
Title: Re: Pong in 6 lines
Post by: Shockwave on September 27, 2006
That's pretty nifty :) It would make a good demo effect if texture mapped onto an object.