Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 7:00 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: TiledMap questions
PostPosted: Mon Dec 26, 2011 12:17 am 
Offline

Joined: Mon Dec 26, 2011 12:02 am
Posts: 2
Hello everyone!
I got a project to do for my graduation and i wanted to make a nice RPG with slick2d.

I have started to learn slick2d for a while, mainly from open code games.

I have several questions that i need to know before i can continue:

1. I took an open source game, and made a new tmx file and loaded it instead of the first one. got some great graphics from RPG maker.
First i made a map in RPG maker and made the image as tmx with tiled editor. the result was game running good but the map is black.. only the sprite is displayed, everything else seems unloaded.
secondly i tried make tile pictures to use in the editor like a pro, same thing happened.
What may cause the map to load and display no errors, but ingame do not display the map itself?

2. Is the sprite image and the map tiles has to be in the same picture?

You guys are my only hope to understand that!
Thanks in advance :)


Top
 Profile  
 
 Post subject: Re: TiledMap questions
PostPosted: Sun Apr 15, 2012 5:04 pm 
Offline

Joined: Wed Mar 28, 2012 9:28 pm
Posts: 16
If I understand your question correctly I would say "no".

I have a tiled background which scrolls using Koopa's Camera class which can be found here In my render method I render the tiled background first and then the sprites on top of that background.

Code:
   @Override
   public void render(GameContainer container, StateBasedGame game, Graphics g)
      throws SlickException {
      camera.centerOn((int)cameraX,(int)cameraY);
      camera.drawMap();
      camera.translateGraphics();
      g.drawImage(tank, tankX, tankY);
   }


This renders the tank on top of the tile. Note, in this code example none of the fancy tank rotation or gun turret code is shown. This is just a minimal example of how I'm rendering a sprite on top of a tile.

Does that help?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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