Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Connecting tiles example

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Aug 2021 23:44
I had no clue what to call this. This could be used as the basis for terrain generation in tilemap games. Given a grid where a tile is either on/off, it'll determine which image to use to form a consistent path or edge. Think of a map editor where you place grass tiles and it automatically calculates the edges. Because I did not want to create a million images, this example only looks at adjacent tiles and not diagonals. This gives 16 possible combinations.

I use an animated sprite and change its frame based on the surrounding tiles whether occupied or not. The tile has an initial value of 0 and increments by the amount shown below of the surrounding tiles if occupied.




I've attached two tilesets I made; some purple blobs and a pipe set. Just click around the screen and the pipes will connect themselves.




Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Aug 2021 03:56
Awesome. I immediatly thought of pacman
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 26th Aug 2021 12:45
Yeah, that's neat, I immediately thought shame we don't have "Liquid Fun" ... I could have some fun with that, liquid and pipes, insta-game.
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Login to post a reply

Server time is: 2024-04-26 18:39:59
Your offset time is: 2024-04-26 18:39:59