Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obscurely coded pong
#29
Maybe not as obscure, but fun to play Smile
Code:
#define pingpong sub
#define ping if
#define pong then
#define paddle line
#define bouncy (
#define play end
#define p1ng elseif
#define pingpongtime timer
dim shared as single pongisfun=240,pw=16,boingboingboing=64,whypongisfun=0,ps=1,boing=320,boingboing=240,bxs,bys,br=10,ms=200,sx=640,sy=480,tm,cs,a,sc,sl=20
pingpong resetit()
    ps-=1
    boing=sx/2
    boingboing=sy/2
    pongisfun=sy/2-boingboingboing/2
    whypongisfun=0
    a= bouncy 1.5*rnd-.75)+3.14*int bouncy rnd*2)
    bxs=cos bouncy a)*ms
    bys=sin bouncy a)*ms
play pingpong
pingpong moveit()
    tm=pingpongtime-tm
    ping multikey bouncy 72) or multikey bouncy 80) pong whypongisfun+=ms*4*tm*sgn bouncy multikey bouncy 80)*2-1)    
    ping abs bouncy whypongisfun) > ms pong whypongisfun=ms*sgn bouncy whypongisfun)
    pongisfun+=whypongisfun*tm
    whypongisfun= bouncy 1-tm)*whypongisfun
    ping pongisfun < boingboingboing/2 pong
        pongisfun=boingboingboing/2
        whypongisfun=-whypongisfun
    play ping
    ping pongisfun > sy-boingboingboing/2 pong
        pongisfun=sy-boingboingboing/2
        whypongisfun=-whypongisfun
    play ping
    boing+=bxs*tm
    boingboing+=bys*tm
    ping boing >= sx-br pong
        boing=sx-br-1
        bxs=-bxs
    p1ng boing-br <= pw pong
        ping boingboing+br > pongisfun-boingboingboing/2 pong
            ping boingboing-br < pongisfun+boingboingboing/2 pong 'collide with paddle
                boing=pw+br
                bxs=-bxs
                ps+=1
            play ping
        play ping
        ping boing-br <= 0 pong resetit()
    play ping
    ping boingboing+br > sy pong
        boingboing=sy-br
        bys=-bys
    p1ng boingboing < br pong
        boingboing=br
        bys=-bys
    play ping
    sc+=tm*8
    tm=pingpongtime
play pingpong
pingpong drawit()
    cls
    me$="                    Obscure Pong Coded By: Deleter  -  Your Score: "+str$(ps)+"        Buy pi!             "
    ping int bouncy sc)>len bouncy me$)-sl/2 pong sc=1
    locate 1,(sx/16+1)-sl/2
    print mid$(me$,int bouncy sc),int bouncy sl))    
    circle bouncy boing,boingboing),br,7
    paddle bouncy 0,pongisfun-boingboingboing/2)-(pw-1,pongisfun+boingboingboing/2),4,b
    paddle bouncy sx/2-sl*4-2,-1)- bouncy sx/2+sl*4+2,10),4,b
    paddle bouncy sx/2-sl*4-3,-1)-bouncy sx/2+sl*4+3,11),12,b
    paddle bouncy sx/2-sl*4-1,-1)-bouncy sx/2+sl*4+4,12),4,b    
play pingpong
tm=pingpongtime
randomize pingpongtime
screenres sx,sy,8,2
sleep 10
resetit
do
    moveit
    drawit
    sleep 1,1
    screenset cs,- bouncy cs-1)
    cs=- bouncy cs-1)
loop until multikey bouncy 1)
[Image: freebasic.png]
Reply


Messages In This Thread
Obscurely coded pong - by Zack - 12-16-2005, 09:25 AM
Obscurely coded pong - by Zap - 12-16-2005, 04:33 PM
Obscurely coded pong - by yetifoot - 12-16-2005, 05:59 PM
Obscurely coded pong - by Anonymous - 12-16-2005, 07:24 PM
Obscurely coded pong - by Zack - 12-16-2005, 11:53 PM
Obscurely coded pong - by yetifoot - 12-17-2005, 12:30 AM
Obscurely coded pong - by thegrogen - 12-17-2005, 02:58 AM
Re: Obscurely coded pong - by NecrosIhsan - 12-17-2005, 03:42 AM
Obscurely coded pong - by yetifoot - 12-17-2005, 05:11 AM
Obscurely coded pong - by KiZ - 12-17-2005, 08:04 AM
Obscurely coded pong - by yetifoot - 12-17-2005, 04:42 PM
Obscurely coded pong - by jupiter3888 - 12-17-2005, 06:48 PM
Obscurely coded pong - by NecrosIhsan - 12-17-2005, 08:51 PM
Obscurely coded pong - by thegrogen - 12-17-2005, 10:13 PM
Obscurely coded pong - by axipher - 12-17-2005, 11:50 PM
Obscurely coded pong - by stylin - 12-18-2005, 12:15 AM
Obscurely coded pong - by axipher - 12-18-2005, 01:05 AM
Obscurely coded pong - by Anonymous - 12-18-2005, 02:53 AM
Obscurely coded pong - by stylin - 12-18-2005, 03:21 AM
Obscurely coded pong - by yetifoot - 12-18-2005, 03:28 AM
Obscurely coded pong - by Z!re - 12-18-2005, 04:34 AM
Obscurely coded pong - by Deleter - 12-18-2005, 05:20 AM
Obscurely coded pong - by KiZ - 12-18-2005, 11:17 PM
Obscurely coded pong - by Zack - 12-18-2005, 11:52 PM
Obscurely coded pong - by axipher - 12-19-2005, 12:13 AM
Obscurely coded pong - by whitetiger0990 - 12-19-2005, 01:03 AM
Obscurely coded pong - by axipher - 12-19-2005, 01:10 AM
Obscurely coded pong - by KiZ - 12-19-2005, 01:18 AM
Obscurely coded pong - by Deleter - 12-19-2005, 01:39 AM
Obscurely coded pong - by axipher - 12-19-2005, 02:00 AM
Obscurely coded pong - by yetifoot - 12-19-2005, 04:37 AM
Obscurely coded pong - by Deleter - 12-19-2005, 04:37 AM
Obscurely coded pong - by axipher - 12-19-2005, 06:12 AM
Obscurely coded pong - by Deleter - 12-22-2005, 03:45 AM
Obscurely coded pong - by axipher - 12-22-2005, 07:18 AM
Obscurely coded pong - by KiZ - 12-22-2005, 08:32 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)