I want a image to follow the mouse, and I use Image class of Slick 2D.:
public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException {
mouseImage = new Image("res/mouse.png");
}
public void render(GameContainer gameContainer, StateBasedGame stateBasedGame, Graphics graphics) throws SlickException {
mouseImage.draw(0,0,0.1f);
}
But it seems that it does not have method for re-positioning a Image object. So how can I implement it (in update
method)? Thanks.