I need some help with the ball physics in DBClassic! The source below works, but it's a bit jerky! Plust the wrapvalue line doesn't do anything because it isn't changing a value being used! Can anyone give me some smooth ball physics!
Pincho.
remstart
bouncing ball using vectors
remend
set display mode 800,600,16
sync on
sync rate 0
hide mouse
make object plain 2,800,600
Load image "Ball.bmp",1
Load image "level1back.bmp",2
texture object 2,2
set camera to object orientation 2
`initilization
set sprite 1,0,1
backdrop off
position object 2,0,0,498
position camera 0,0,0
`x & y coords and angle of the ball
x#=300
y#=300
angle#=70
`setup component vector
dim comv#(1)
comv#(0)=0
comv#(1)=0
`calculate the component vector start angle
comv#(0)=sin(angle#)*10
comv#(1)=cos(angle#)*10
do
`check to make sure ball isn't offscreen
if x#<0 or x#>800-22 then comv#(0)=comv#(0)*-1
if y#<48 or y#>600-48-22 then comv#(1)=comv#(1)*-1
angle#=wrapvalue(angle#)
`reposition the ball
x#=x#+comv#(0)
y#=y#+comv#(1)
sprite 1,x#,y#,1
`position object 1,x#-400,y#-300,497
sync
loop