Slick Forums

Discuss the Slick 2D Library
It is currently Fri May 24, 2013 3:18 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Apr 29, 2012 12:20 pm 
Offline

Joined: Sun Apr 29, 2012 12:40 am
Posts: 1
Hello

I am pretty new to Slick but I already got a map loaded from Tiled Editor with a Spritesheet as Character which can move around with collision detection.
My problem now is that is when I move for example left I want, instead of the character "warping" from one tile to another, the character to be drawn like a "real" animation meaning that after I press left the characters gets drawn 1 pixel after another until it arrives at the next tile

Unfortunately when I use g.drawAnimation multiple times it draws the player multiple times.
I would need something along the lines:

Code:
for(int i=1;i<16;i++){
  delete_previous_player(); //<- dunno how to achieve this
  drawPlayer(x-i,y);
  container.sleep(5);
}

I have no idea how to achieve this.
Apparently I shouldn't do or can't do any drawings in update() and should do it in render()
g.flush() and g.clear() somehow didn't work, maybe I used the in the wrong way...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group