Ok, so at this point, I have a project setup with a canvas, surfaceview, and a bar has to move across the screen.
I have setup everything like this:
-Main activity class
SurfaceView class
-while(true) { c.drawRect(x & y) } (using X, Y position)
}
Thread barMovement {
while(true){ x+=1; y+=1; }
}
}
Question:
So this works, but I have noticed that it's not very smooth. Some times, the bar goes a little faster, some times its slower.
I was wondering if this method is the best way to do it? When looking at apps like FlappyBird for example, the movement is absolutely perfect. How do they achieve this?
Thanks, Jason