Im trying to get a sprite to move up when the user clicks a button.
Below is the code I have so far.
What happens: When the user clicks, the image moves like lightning and just appears at the top of the screen.
What I want: For the image to move slowly and smoothly.
I think its one of 2 reasons why its moving so fast.
1.the math is wrong
2.I am using the wrong loop for the situation
I have put the deltaTime in there if you think that will help some way.
Thankyou in advance. Ill give you a green + if you know the answer.
Application::input(float deltaTime)
{
posX = pInput->mousePositionX();
bFire = pInput->mouseDown();
if(bFire)
{
do
{
posY -= 0.0001; // the current pos is at 420
}while(posY > 0);
}
}

New Topic/Question
Reply




MultiQuote





|