ooh, thats cool, check it out, i messed with it a lil bit, what you think about this:
g= 150
b= 255
gosub makeobjects
balla# = 90
sync on: sync rate 40 : hide mouse : do
gosub pulseforcefield
ballx#=newxvalue(ballx#,balla#,.3) : ballz#=newzvalue(ballz#,balla#,.3)
gosub movement
gosub collischeck
gosub placeobjects
gosub scoring
sync:loop
makeobjects:
set ambient light 5
make object box 1,1,1,3:color object 1,rgb(255,0,0)
make object box 2,1,1,3:color object 2,rgb(0,255,0)
make object sphere 3,1:color object 3,rgb(0,150,255)
make object box 4,14,0.1,10:color object 4,rgb(150,150,150)
make object sphere 5,0.5:color object 5, rgb(255,0,0)
ghost object on 3
return
movement:
if upkey()=1 and z1#<4.5 then z1#=z1#+0.3
if downkey()=1 and z1#>-2.5 then z1#=z1#-0.3
if keystate(17)=1 and z2#<4.5 then z2#=z2#+0.3
if keystate(31)=1 and z2#>-2.5 then z2#=z2#-0.3
return
collischeck:
if upkey()=1 and ballx#>5 and ballx#<5.5 then balla#=balla#+8
if downkey()=1 and ballx#>5 and ballx#<5.5 then balla#=balla#-8
if keystate(17)=1 and ballx#<-5 and ballx#>-5.5 then balla#=balla#+8
if keystate(31)=1 and ballx#<-5 and ballx#>-5.5 then balla#=balla#-8
if ballx#>5.5 and ballx#<6 and ABS(z1#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4.5 and ballx#>-5.5 and ABS(z2#-ballz#)<1.5 then balla#=360-balla#
if ballx#>5.5 and ballx#<6 and ABS(ballz#-z1#) <= 1.5 then balla# = 180 - balla#
if ballx#<-5.5 and ballx#<-5 and ABS(ballz#-z2#) <= 1.5 then balla# = 180 - balla#
if ballz#>6 or ballz#<-4 then balla#=180-balla# : balla#=wrapvalue(balla#)
return
placeobjects:
position object 1,6,0,z1#:position object 2,-6,0,z2#
position camera 0,10,-5:point camera 0,0,0
position object 3,ballx#,0,ballz# : yrotate object 3,balla#
position object 4,0,-0.55,0
position object 5,ballx#,0,ballz#
return
scoring:
if ballx#>10 then p2#=p2#+1:ballx#=0:ballz#=0:balla#=270 : z1# = 0 : z2# = 0 : sleep 500
if ballx#<-10 then p1#=p1#+1:ballx#=0:ballz#=0:balla#=90 : z2# = 0 : z1# = 0 : sleep 500
set cursor 300,50:print p2#
set cursor 320,50:print "-"
set cursor 340,50:print p1#
return
pulseforcefield:
CoreThrob# = CoreThrob# + 5
CoreThrob# = wrapvalue( CoreThrob# )
scale object 5, 100 + sin(CoreThrob#)*15, 100 + sin(CoreThrob#)*15, 100 + sin(CoreThrob#)*15
scale object 3, 100 + sin(CoreThrob#)*20, 100 + sin(CoreThrob#)*20, 100 + sin(CoreThrob#)*20
return
i want to have the ball change colour as it pulse i tried, but i can't get it, its ok though, i cant get the ball lined up with collision right on the right paddle
Welcome to Hypocrite In A Box, May I change your order?