Here is my second 20 liner (actually 9 lines!). This game requires very quick reflexes. See how many points u can get. Check out Meteor Swarm if u havent yet. Here is the code.
` Pong 4
` Controls
`Move upper\lower paddles Move Mouse Left\Right
`Move right\left paddles Move Mouse Upper\Lower
sync on:sync rate 60:randomize timer():set display mode 640,480,16:set text size 18:c1 = rgb (rnd(250),rnd(250),rnd(250)):c2 = rgb (rnd(250),rnd(250),rnd(250)):ink c1,c2:box 0,0,640,480:lx = 450:c11=250:for t = 1 to 450:c1 = rgb(c11,c11,c11):c2 = rgb(c11,c11,c11):ink c1,c2:circle 320,240,lx:lx = lx - 1:c11 = c11 - 1:next t:get image 1,0,0,640,480:autocam off:hide mouse:move camera -25:make object box 1,.5,5,1:move object right 1,10:make object box 2,.5,5,1:move object right 2,-10:make object box 3,5,.5,1:move object up 3,10:make object box 4,5,.5,1:move object up 4,-10:make object sphere 5,.5:randomize x:mx# = rnd(5)+5:my# = rnd(5)+5:if mx# = 0 then mx# = mx#+1.325:if my# = 0 then my# = my#+1.325:mx# = mx#/100
my# = my#/100:make object cube 6,100:texture object 6,1:move object 6,-20:set object cull 6,0:rx# = rnd(10):ry# = rnd(10):rx# = rx#/100:ry# = ry#/100:for t = 1 to 4:c1 = rgb(50,50,50):color object t,c1:next t:c1 = rgb(150,150,150):color object 5,c1:c1 = rgb(150,150,150):c2 = rgb(0,0,0):ink c1,c2:position light 0,0,0,-20
do:set cursor 250,220:print "Press Space to begin":if spacekey() = 1:exit:endif
loop:do:xrotate object 6,object angle x(6)+rx#:yrotate object 6,object angle y(6)+ry#:set cursor 205,430:print "POINTS: ";points;" Hi-Score: ";hiscore:move object up 5,my#:move object right 5,mx#:if object collision (5,1) = 1 or object collision(5,2) = 1: mx# = -mx#:endif:if object collision (5,3) = 1 or object collision(5,4) = 1: my# = -my#:endif
if object collision (5,1) = 1: move object right 5,-.1:endif:if object collision (5,2) = 1: move object right 5,.1:endif:if object collision (5,3) = 1: move object up 5,-.1:endif:if object collision (5,4) = 1: move object up 5,.1:endif:mmx# = mousemovex():mmy# = mousemovey():move object up 1, -mmy#/5:move object up 2, -mmy#/5:move object right 3, mmx#/5:move object right 4, mmx#/5
if object position y(1) > 7.5: position object 1,10,7.5,0:position object 2,-10,7.5,0:endif:if object position y(1) < -7.5: position object 1,10,-7.5,0:position object 2,-10,-7.5,0:endif:if object position x(3) > 7.5: position object 3,7.5,10,0:position object 4,7.5,-10,0:endif:if object position x(3) < -7.5: position object 3,-7.5,10,0:position object 4,-7.5,-10,0:endif:mx# = mx# + (mx#/2000):my# = my# + (my#/1666):points = points + 1
if object position x(5) < -11 or object position x(5) > 11 or object position y(5)>11 or object position y(5)< -11:if points>hiscore and points > 2: hiscore = points:endif
position object 5,0,0,0:do:set cursor 205,430:print "POINTS: ";points;" Hi-Score: ";hiscore:set cursor 250,220:print "Press Space to Start":if spacekey() = 1: exit:endif
loop:mx# = rnd(5)+5:my# = rnd(5)+5:if mx# = 0: mx# = mx#+1.325:endif:if my# = 0: my# = my#+1.325:endif:mx# = mx#/100:my# = my#/100:points = 0:c1 = rgb(150,150,150):c2 = rgb(0,0,0):ink c1,c2:endif:sync
loop
Edit: When I first posted this game I was still new to the website so the source code button doesn't work. The code above is the same game as the original except there is a sync rate now.
Justin Cannizzaro