I just suddenly felt like making a crappy little air hockey game....here's the code (No Media)
`setup
sync on
sync rate 0
hide mouse
`create floor
make object box 1,300,4,500
create bitmap 1,32,32
cls rgb(255,255,255)
ink rgb(0,0,0),0
box 6,1,9,15
get image 1,0,0,32,32
delete bitmap 1
texture object 1,1
scale object texture 1,100,200
position object 1,0,0,0
`create player 1
make object cylinder 2,30
scale object 2,100,30,100
color object 2,rgb(0,255,0)
position object 2,0,7,-145
make object cylinder 6,10
scale object 6,70,100,70
color object 6,rgb(0,255,0)
position object 6,0,7,-145
`create computer player
make object cylinder 3,30
scale object 3,100,30,100
color object 3,rgb(255,0,0)
position object 3,0,7,145
make object cylinder 7,10
scale object 7,70,100,70
color object 7,rgb(255,0,0)
position object 7,0,7,145
`create a ball
make object cylinder 4,10
scale object 4,100,30,100
position object 4,0,7.3,0
color object 4,rgb(0,0,255)
`update backdrop
make object box 5,300,600,500
position object 5,0,300,0
color object 5,rgb(255,0,0)
set object 5,1,0,0
ghost object on 5
`create walls
make object box 8,300,15,10
position object 8,0,7.5,245
color object 8,rgb(255,0,0)
make object box 9,300,15,10
position object 9,0,7.5,-245
color object 9,rgb(255,0,0)
make object box 10,10,15,500
position object 10,-145,7.5,0
color object 10,rgb(255,0,0)
make object box 11,10,15,500
position object 11,145,7.5,0
color object 11,rgb(255,0,0)
`lighting
set ambient light 40
make light 1
color light 1,rgb(255,255,0)
position light 1,0,90,0
make light 2
`position camera
cam1x#=0
cam2x#=0
cam3x#=0
cam1y#=120
cam2y#=280
cam3y#=120
cam1z#=-270
cam2z#=0
cam3z#=270
position camera cam1x#,cam1y#,cam1z#
point camera 0,0,0
`variables
ballx#=0
ballz#=0
bry#=rnd(180)
if bry#>200 then bry#=200
if bry#<160 then bry#=160
acl#=3
aal#=1
plx#=0
cox#=0
scorepl=0
scoreco=0
campos=1
`main loop
do
`position camera
if inkey$()="1" then position camera cam1x#,cam1y#,cam1z# : point camera 0,0,0 : campos=1
if inkey$()="2" then position camera cam2x#,cam2y#,cam2z# : point camera 0,0,0 : campos=2
if inkey$()="3" then position camera cam3x#,cam3y#,cam3z# : point camera 0,0,0 : campos=3
`control player
if campos<3
plx#=(mousex()-screen width()/2)/2
if mousex()>569 then position mouse 569,0
if mousex()<71 then position mouse 70,0
position object 2,plx#,7,-145
position object 6,plx#,17,-145
else
plx#=((mousex()-screen width()/2)/2)*-1
if mousex()>569 then position mouse 570,0
if mousex()<71 then position mouse 70,0
position object 2,plx#,7,-145
position object 6,plx#,17,-145
endif
`simple AI
if ballz#>0 and ballx#>cox# then inc aal#,1.3 : inc cox#,aal#
if ballz#>0 and ballx#<cox# then inc aal#,1.3 : dec cox#,aal#
if ballz#>0 and ballx#>0 and ballx#=cox# then inc aal#,1.3 : inc cox#,aal#
if ballz#>0 and ballx#<0 and ballx#=cox# then inc aal#,1.3 : dec cox#,aal#
if aal#>6 then aal#=6
if cox#>130 then cox#=130
if cox#<-130 then cox#=-130
position object 3,cox#,7,145
position object 7,cox#,17,145
`control ball
position object 4,ballx#,7.3,ballz#
yrotate object 4,bry#
inc acl#,0.003
if acl#>10 then acl#=10
ballx#=newxvalue(ballx#,bry#,acl#)
ballz#=newzvalue(ballz#,bry#,acl#)
if ballx#>135 or ballx#<-135 then bry#=360-bry#
if ballz#<-250 then ballz#=0 : bry#=180-bry# : acl#=1 : scoreco=scoreco+1
if ballz#>250 then ballz#=0 : bry#=180-bry# : acl#=1 : scorepl=scorepl+1
if ballz#<-125 and ballz#>-145 and ABS(plx#-ballx#)<18 then bry#=180-bry#
if ballz#>125 and ballz#<145 and ABS(cox#-ballx#)<18 then bry#=180-bry#
bry#=wrapvalue(bry#)
`show score
ink rgb(0,0,255),0
text 10,10,"Score: "
ink rgb(0,255,0),0
text 10,30,"Player 1: "+str$(scorepl)
ink rgb(255,0,0),0
text 10,50,"Computer: "+str$(scoreco)
`end loop
sync
loop
You move with the mouse, and change camera views with buttons 1,2 and 3.
To all the newbies: If you wants a tutorial on how to make games like air hockey or pong just ask
"Well, if he dies, it'll teach him not to do it again." - Me