I wouldn't put a loop inside a function like that.
Did you call sync on?
This:
xpos = xstart : ypos = ystart
Is meaningless, unless those variables were set global outside the function. In which case, bad practice, pass the values to the function as parameters. Even so, you're overwriting xpos/ypos just below it anyway so it's still pointless.
You also have a typo where you spelled 'angle' wrong, resulting in 0 being passed to the equation instead. That could cause issues.
Also, to make a code snippet, just click the code button twice to make the starting and ending tags and wrap your code inside it.
[ code ] insert code here
[ /code ]
time as float
sync on
sync rate 60
DO
cls
if spacekey() = 1
shootBall = 1
xstart = `some starting number
ystart = `some starting number
time = 0.0
endif
if shootBall = 1
`calculate the new location of the ball
new_xpos = v0 * time * cos(algle)
new_ypos = v0 * time * sin(angle) - (0.5 * gravity *(time^2))
`update the x,y variables for the ball
xpos = xstart + new_xpos
ypos = ystart - new_ypos
`check if the ball is going to go off the screen
if xpos > screen width() or xpos < 0 or ypos > screen height() or ypos < 0 then shootBall = 0
`check if the ball hit the basket
if sprite hit(1,2)=1 then shootBall = 0
`advance the time
time = time + 0.3
if shootBall = 0
xstart = `some starting number
ystart = `some starting number
endif
endif
`put the ball at the new position in screen memory
sprite 1, xpos, ypos, 1
sync
LOOP
"You're all wrong. You're all idiots." ~Fluffy Rabbit