Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 19, 2013 4:32 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Random Map
PostPosted: Wed Mar 07, 2012 2:03 am 
Offline

Joined: Sun Oct 16, 2011 8:31 pm
Posts: 50
Is there a way that I could make a randomly generated map (random enough to look like the ones in the images), while still using a TileD format?
Image

I'm thinking maybe the Tiled map, could just be a big rectangle while the tiles inside don't permit entry to outer zones, but this needs to be generated via function somehow. Ideas would be appreciated!
Image (where the dark red is the boundries)
I was thinking of something like this, the boundries are calculated based on wether the point is closer to (x,y) or (x - 1, y) etc
Image

I would really prefer a Tiled map though, although if it's in no way possible, I can use an Array[][]. (If it's not possible with Tiled, and I have to use an array can I still get the help for it please?)


Edit: So I just made this, and I'll be able to use a point in the middle of each tile to see if it is eligible to be a piece of ground. The math/shapes will change the make it broader with less nooks/crannies etc.

Edit2: So now I've got this; The circles have to be touching, or they get remade (onto the last circle that made it)
Image
Now I'm about to write a function (I've got it in psuedocode) to turn these shapes into tile objects.

I have pretty much answered my own question, but I've not finished yet!


Top
 Profile  
 
 Post subject: Re: Random Map
PostPosted: Thu Mar 08, 2012 11:41 am 
Offline

Joined: Sun Oct 16, 2011 8:31 pm
Posts: 50
I thought that I would make a new post to this, to keep it separate.
http://www.youtube.com/watch?v=9RbuI9HCwYE
I have Image, which shows the one ellipse. But there is also this one, that shows more than one! Image


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