[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

# Re: [pygame] resources for edge tile algorithm

```If you're looking at generating random tilemaps I have some code to do that.
<http://mccormick.cx/news/entries/blog-post-game-code-dabbling>
Let me know if anyone wants it and I'll put it online!

Best,

Chris.

On Wed, Jun 24, 2009 at 08:35:31PM -0700, Devon Scott-Tunkin wrote:
>
> I don't know if this is helpful but I came across it the other day.
>
> http://www.gamedev.net/reference/articles/article934.asp
>
> I believe it's basically just saying that when creating the top transition tile layer check the 8 surrounding tiles of each tile on the screen (or the whole generated map if you want) to see if they are of a lower terrain type then the current tile. If so, apply the correct transition tile to use from a tilesheet indexed the same as the for loop doing the checking or however you want to keep track of which edge of the tile you're currently checking.
>
> I haven't done it myself, but if you get something working let me know. I am planning on doing the same thing in one of my projects but it is a ways off.
>
> Devon
>
>
> --- On Wed, 6/24/09, Michael Fiano <michael.fiano@xxxxxxxxx> wrote:
>
> > From: Michael Fiano <michael.fiano@xxxxxxxxx>
> > Subject: [pygame] resources for edge tile algorithm
> > To: pygame-users@xxxxxxxx
> > Date: Wednesday, June 24, 2009, 9:07 PM
> > I am looking into edge tile placement
> > algorithms for 2D square tile
> > maps, for the pygame 'bloodcurse'. The idea is I
> > have a layer of square
> > tiles representing each type of terrain laid down. Then
> > another layer
> > with transparent curves is layered over the top of the
> > previous layer
> > to create transitions from terrain x to y. I can do this
> > fine manually,
> > but I was wondering what similar ideas anyone has done, or
> > any relevant
> > links on the subject? Ultimately, layer 1 will be randomly
> > generated,
> > and 2 will have to follow.
> >
> >
> > Thanks
> >
>
>
>
-------------------
http://mccormick.cx

```