this is the worst game of pong ever (but i never did like the original)
anyway have fun with it.....
updated code
Rem Project: Pin-Go
Rem Created: 2/13/2006 8:28:53 PM
Rem ***** Main Source File *****
Rem Pin-Go
Rem this was on the old computer
rem but then it got deleted
rem so this is a started over version
rem hopefully bigger and better
sync on
sync rate 10
randomize timer()
ink rgb(rnd(255),rnd(255),rnd(255)),rgb(rnd(255),rnd(255),rnd(255))
set current camera 0
`players
player1pos#=0
player2pos#=0
make object box 1,.5,.5,1.5: color object 1,rgb(rnd(255),rnd(255),rnd(255)): position object 1,5,0,0
make object box 2,.5,.5,1.5: color object 2,rgb(rnd(255),rnd(255),rnd(255)): position object 2,-5,0,0
`ball
make object sphere 3,.5: color object 3,rgb(rnd(255),rnd(255),rnd(255)): position object 3,0,0,0
set object specular 1,rgb(rnd(255),rnd(255),rnd(255))
ballx#=object position x(3)
ballz#=object position z(3)
balla#=rnd(90)-45
`arena
make object plain 9999,10,7: position object 9999,0,.1,0:color object 9999,rgb(rnd(255),rnd(255),rnd(255))
rotate object 9999,90,0,0
make object box 9998,10,1,.1: position object 9998,0,0,3.5: color object 9998,rgb(rnd(255),rnd(255),rnd(255))
make object box 9997,10,1,.1: position object 9997,0,0,-3.5: color object 9997,rgb(rnd(255),rnd(255),rnd(255))
`camera
make camera 1
position camera 1,0,10,-5: point camera 1,0,0,0
`main
do
if mouseclick()=2
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
endif
`movement
if upkey()=1 and player1pos#<=2.5
player1pos#=player1pos#+.3
endif
if downkey()=1 and player1pos#>=-2.5
player1pos#=player1pos#-.3
endif
`collision
if object collision(1,3)
move object 3,-0.6
balla#=rnd(60)+150
endif
if object collision(2,3)
move object 3,-0.6
balla#=rnd(60)+150
endif
if object collision(3,9998)
move object 3,-0.6
balla#=rnd(60)+150
endif
if object collision(3,9997)
move object 3,0.6
balla#=rnd(60)-30
endif
ballx#=object position x(3)
ballz#=object position z(3)
position object 3,newxvalue(ballx#,balla#,1),0,newzvalue(ballz#,balla#,0.5)
position object 1,5,0,player1pos#
position object 2,-5,0,player2pos#
if object position x(3)>6
inc compscore
position object 3,0,0,0
endif
if object position x(3)<-6
inc playerscore
position object 3,0,0,0
endif
center text screen width()/2,0,"player score = "+str$(playerscore)
center text screen width()/2,20,"computers score = "+str$(compscore)
if playerscore=10 or compscore=10 then exit prompt " we have a winner","win condition met" : end
sync
loop
main problem was that u were using variables and not telling the comp what they were, i.e. u used 'ballz#' and 'ballx#' but didn't have 'ballz#=.......' in ur code
sorry about the camera problem, not sure on that one, probably the same sort of thing though
life's one big game
spec= 2ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic