Author Topic: Pong in 6 lines[BB2D]  (Read 2774 times)

0 Members and 1 Guest are viewing this topic.

Offline nawitus

  • C= 64
  • **
  • Posts: 50
  • Karma: 1
    • View Profile
Pong in 6 lines[BB2D]
« 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
« Last Edit: July 21, 2007 by Shockwave »

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Pong in 6 lines
« Reply #1 on: September 27, 2006 »
Very nice  :)
Challenge Trophies Won:

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
Re: Pong in 6 lines
« Reply #2 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
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Pong in 6 lines
« Reply #3 on: September 27, 2006 »
That's pretty nifty :) It would make a good demo effect if texture mapped onto an object.
Shockwave ^ Codigos
Challenge Trophies Won: