I’ve a problem with my sprite’s movement, it’s not linear (the sprite move with “jumps”)
I’ve a principal class that calculate the elapsed time like this:
public void gameLoop()
{
// Calcola il tempo attuale
long startTime = System.currentTimeMillis();
long currTime = startTime;
while(gameRunning)
{
long elapsedTime = System.currentTimeMillis() - currTime;
currTime += elapsedTime;
resource.update(elapsedTime);
Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
resource.draw(g);
strategy.show();
}
}
the draw method is in a class that manages all the objects:
// Disegna le sprites
Iterator i = map.getSprites();
while(i.hasNext())
{
Sprite sprite = (Sprite)i.next();
int x = Math.round(sprite.getX()) * TILE_WIDTH;
int y = Math.round(sprite.getY()) * TILE_HEIGHT;
g.drawImage(sprite.getImage(),x,y,null);
}
what I’ve to change?

which are conisderably worse than win XP
:(, but we’ll see how it goes. I can always force that to nanotime, since java2d doesn’t work on OS X with less than 1.4 anyway (PNG’s don’t load, for instance. Thankfully you can mostly count on 1.5 being installed these days (anyone who downloads the auto OS updates will have it)