Original Post
I'm making a simple simulation of a ball thrown up in the air (ignoring air resistance). When the ball reaches it's maximum height it stays there for about a second. Surely this isn't right (although it does come down again)?
double time=0;
double yspeed = 70,yacc =5;
while (true)
{
yacc = yacc - (9.81/50); //remove a 50th of deacceleration due to gravity
yspeed = yspeed + (yacc/50); //add acceleration to speed
ballpos.y = ballpos.y - (yspeed/50); //change ballposition to reflect speed (ball pos starts at bottom of screen)
SDL_BlitSurface (background,NULL,screen,NULL);
SDL_BlitSurface (block,NULL,screen,&ballpos);
SDL_Flip(screen);
time = time + 0.02;
SDL_Delay(20); //50 fps
}