Hi, I`ve a problem displaying sprites using GAGE:
I try to display a sprite, but it does not work, hee is my code:
public void run() {
AdvancedTimer timer = new AdvancedTimer();
Graphics2D g;
BufferStrategy strategy = this.getBufferStrategy();
int sleepTime = 30;
timer.start();
while (running) {
g = (Graphics2D) strategy.getDrawGraphics();
g.setColor(Color.white);
//Draw the Map
this.map.render(g);
//Draw the player
this.sprite.render(g, 0, 0);
this.sprite.setX(spriteX);
this.sprite.setY(spriteY);
g.dispose();
strategy.show();
try {
Thread.sleep(sleepTime);
} catch (InterruptedException exc) {
exc.printStackTrace();
}
}
timer.stop();
}