Slick Forums

Discuss the Slick 2D Library
It is currently Tue Jun 18, 2013 9:30 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Sep 19, 2008 11:11 pm 
Offline

Joined: Sat Aug 30, 2008 9:29 pm
Posts: 11
Im making a platformer and i have a designated spot on the map for the start player location. Is there a way to get the x and y of that say, layers object and this being the only thing the layer prints?

thanks im learning but im still not that great.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 20, 2008 4:24 pm 
Offline
User avatar

Joined: Tue Nov 06, 2007 7:33 am
Posts: 37
This is how most people set locations for dynamic entities and other things that need to be added in game, instead of in the map editor.

They will use a different layer to specify where thing go, such as the player start location. Then, they will take a tile with a property of something like "object", and a value of maybe "playerstart" (or whatever you want to use). Then, in the game code, they just look for this property, and set that as the player start location. This will also work for pretty much anything like that, such as enemy start locations, things like that.

You could also just set the x and y of the starting point in the map properties pane. Never tried this, but I'm sure it works fine. Just whichever is easier for you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2008 3:15 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
i agree with TheTwitchy: best idea is a layer for non-drawable thing in tiled, with a special properties, for example: player start, enemies positions, etc..

You can see here a little example:

https://timehero.svn.sourceforge.net/sv ... Mappa.java

When i load map file, i load matrix for every layer: player, objects..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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