I have been working for about the past hour on making code for the vertical bounce of the ball in 3d pong. Some help would be nice.
sync on
MAKE OBJECT BOX 1, 2, 10, 5
color object 1,rgb(200,20,20)
SET OBJECT COLLISION ON 1
MAKE OBJECT BOX 2,80,40,2
color object 2,rgb(0,100,0)
MAKE OBJECT BOX 3, 2,10, 5
color object 3,rgb(0,0,100)
SET OBJECT COLLISION ON 3
make object box 4,80,5,20
set object collision on 4
make object box 5,80,5,20
set object collision on 5
MAKE OBJECT SPHERE 6, 2
set object collision on 6
position object 2,0,0,100
position object 3,35,0,90
position object 1,-35,0,90
position object 4,0,20,100
position object 5,0,-20,100
position object 6,0,0,90
position camera 0,20,0
paddle2y=0
playery=0
ballx=0
bally=0
updown=0
suspend for key
color backdrop rgb(0,0,0)
do
position object 3,35,paddle2y,90
position object 1,-35,playery,90
position object 6,ballx,bally,95
if upkey()=1 then playery=playery+1
if downkey()=1 then playery=playery-1
if object hit(1,4) then playery=playery-1
if object hit(1,5) then playery=playery+1
if object hit(6,4) then updown=1
if object hit(6,5) then updown=0
if updown=1 then bally=bally-1
if updown=0 then bally=bally+1
paddle2y=bally
Sync
loop