I have a ball that you can make jump,
I have a sneaking suspicion I'm doing this wrong. It works now, to the extend that gravity pulls the object down toward the ground, but I'm having trouble manipulating the speed of the object.
What this is, is a ball jumping and falling towards the ground.
I have another function called "jump" that just adds a value to it's yVel
I can increase gravity, and it falls faster.
I can increase the jSpeed speed, and it'll rise up longer, but not faster
But I can't get it to do everything faster. It just looks painfully slow, which may or may not be because of my emulator running at 11 fps, on average.
Is it just my emulator, or is it something on my end?
float time = elapsedTime/1000F;
if (speed < maxSpeed){
speed = speed + accel;
}
if(mY + mVelY < Panel.mHeight){ //0,0 is top-left
mVelY += (speed);
}
if (!(mY + height >= Panel.mHeight)){
mVelY = mVelY + gravity ;}
mX = (float) (mX +(mVelX * time));
mY = (float) (mY + (mVelY * time));