1
\$\begingroup\$

I want to make a tile-based platformer in AS3.

I want my game to read an external maps file (in xml or json or somethimg similar) to draw a tile-based map.

I've seen loads of tutorials for this in AS2 and other languages, and the few I've found in AS3 are either incomplete or filled with extra unnecessary features. I just want to be able to draw a basic map from sprites in Flash.

Any links or information to point me in the right direction would be appreciated.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ As the answers show, questions like this just generate a list of responses without one being more correct than the others. I think it's not constructive and I'm voting to close. \$\endgroup\$
    – House
    Jan 14, 2013 at 20:04

4 Answers 4

1
\$\begingroup\$

A while ago I shared the AS3 code (+sample project) for a TMX parser on my blog: http://blog.pixelpracht.net/?p=59

TMX is the map format used by the Tiled Map Editor which imho is one of the best engine-independant editors for tile based maps.

\$\endgroup\$
1
\$\begingroup\$

FlashPunk supports that, you can even import a map made with Ogmo Editor.

\$\endgroup\$
1
\$\begingroup\$

Leading library about isometric tile-system: as3isolib.

This is a really powerful tool. The best side of this library, is that you don't have to waste weeks on it, it has only a few simple functions, it is highly optimized and as you can see huge projects use this library.

There's a great tutorial on as3isolib on gotoAndLearn: Part 1, Part 2.

\$\endgroup\$
0
1
\$\begingroup\$

Various Flash game frameworks have this sort of functionality built in. The gist:

1) Load your map data. Lookup how to load XML/JSON in Flash.

2) Loop through the data in order to figure out where to place tiles.

2b) While looping through the data, instantiate the appropriate images and place them at the coordinates defined in the data.

Pseudocode:

var tileMap:Object = loadedJSON;
for each (var tileData:Object in tileMap) {
  var tile:MovieClip = new MovieClip from tileData.clip;
  tile.x = tileData.x;
  tile.y = tileData.y;
  addChild(tile);
}

(yes I know new MovieClip from tileData.clip isn't valid code. I said this is pseudocode; figure out how to instantiate MovieClips)

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .