The Daily Click ::. Forums ::. Klik Coding Help ::. Automatic Tile Corner Detection?
 

Post Reply  Post Oekaki 
 

Posted By Message

tristanjmnz



Registered
  10/07/2010
Points
  432
11th August, 2011 at 18:25:33 -

I'm making a level editor/creator and I'd like to know if somebody knows how to make an object sense if their is an object (the same object) above it, below it, etc. So it can make the corners of the tile automatically (by changing the direction of the object which will have all the different corner types). I've tried looping it, but I failed. Any suggestions/methods?

 
Check out Project Float at:
http://www.desura.com/games/project-float

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
11th August, 2011 at 20:51:26 -

http://www.create-games.com/article.asp?id=1869

 
n/a

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2723
13th August, 2011 at 18:11:18 -

Interesting question and approach of using the directions from a tile as a tile state. It sounds a lot like horizontally or vertically flipping a tile in the editor.

A basic way for a tile editor is to have a tile corresponding to a tile number, the number <-> tile connection. You will be having multiple tiles, if I am correct, and multiple states for that tile. So you need to save the tile state in this case too, not just the number.

And with tile state I actually mean the set rotation/direction in this case. If a small tile map is like this:
1 1 1
1 0 1
1 0 1
Then you could try to add a delimiter for the direction of the tile, like this:
1:1 1:0 1:2
1:0 0:0 1:0
1:0 0:0 1:0
Where:
0:0 is an empty spot,
1:0 is regular wall,
1:1 is cornered wall for the top left position
1:2 is cornered wall for the top right position.

Good luck coding and loading!

 
Image jenswa.neocities.org
   

Post Reply



 



Advertisement

Worth A Click