Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / 17-line pong

Author
Message
Phoenix
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 22nd Feb 2003 23:37
This pong game is for Dark Basic Pro. I'm not sure if it'll work on any other DB software so I would really appreciate it if any one would tell me if it works with anything else

hide mouse : backdrop on : p1=200 : p2=200 : sw=320
sh=240 : _pause: : do : if scancode()>0 then go=1 : ink rgb(0,200,0),rgb(0,200,0)
box 2,p1,7,p1+40 : box 632,p2,637,p2+40 : circle sw,sh,4 : ink rgb(0,0,200),rgb(0,0,200) : line screen width()/2,0,screen width()/2,700
box 0,25,700,35 : box 0,screen height()-10,700,screen height() : set cursor 0,0 : print "player 1 score=";s1
set cursor screen width()/2+5,0 : print "player 2 score=";s2 : ink rgb(200,0,0),rgb(200,0,0) : set cursor 50,50 : print "PRESS ANY KEY TO CONTINUE" : if go=1
go=0 : goto _begin : endif : loop : _begin:
do : cls rgb(0,0,0) : gosub _main : gosub _pongs : gosub _ball
gosub _stats : loop : _main: : ink rgb(0,200,0),rgb(0,200,0) : box 2,p1,7,p1+40
box 632,p2,637,p2+40 : circle sw,sh,4 : ink rgb(0,0,200),rgb(0,0,200) : line screen width()/2,0,screen width()/2,700 : box 0,25,700,35
box 0,screen height()-10,700,screen height() : return : _pongs: : if upkey()=1 then dec p1 : if downkey()=1 then inc p1 : if escapekey()=1 then end
if p2+20>sh then dec p2 : if p2+20sh) then ball=1 : endif : if ball=1 : sw=sw-2
if sw=8 and p1sh) then ball=0 : endif : if sw>640 : inc s2 : sw=screen width()/2
sh=screen height()/2 : goto _pause : endif : if sw
Phoenix
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 22nd Feb 2003 23:41
Oops. that did'nt work. Oh well i'll just do it normally for now.

Phoenix
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 23rd Feb 2003 03:29
OK here's the final one. I'm still not sure whatversions it works with. But i'm positive it works with Pro.



Now all I have to do is make the lines smaller and c if I win the 20 line challenge.
Jadelion
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 23rd Feb 2003 07:26
I kinda worked in DB 1.06 (funny that I still have that) the screen flickered a lot and the ball passed right through the paddel and I didn't have movment (with the up or down key) but I did see PONG for awhile.
Phoenix
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 23rd Feb 2003 17:14
Oh well I guess it just for pro then
but thanks 4 testin' it for me

Login to post a reply

Server time is: 2024-04-18 02:23:00
Your offset time is: 2024-04-18 02:23:00