I am attempting to make a pinball-esque game where you control the ball, but I cant seem to make the ball stop rolling backwards when I tell it to stop. Any help would be appreciated.
make object sphere 1,10
position camera 0,100,-50
point camera 0,0,0
balls#=0.0
ballt#=0.2
balla#=90
ballx#=0
ballz#=0
do
ballm#=balls#-ballt#
position object 1,Ballx#,0,ballz#
if upkey()=1 and balls#<1.5 then balls#=balls#+0.01
if upkey()=0 and balls#>0.1 then balls#=balls#-(ballt#/10)
if leftkey()=1 then balla#=balla#+1
if rightkey()=1 then balla#=balla#-1
ballx#=newxvalue(ballx#,balla#,ballm#)
ballz#=newzvalue(ballz#,balla#,ballm#)
balla#=wrapvalue(balla#)
loop
I use darkbasic classic and i practically have no experience.