4
\$\begingroup\$

I am trying to make the age-old version of pacman. And only then that I realized that I need to spend a heck lot of time for making the tile matrix itself. It gets messy more and more.

I've also heard of this thing called level editors; Are there any of these kind for flash based games. If so, do write it down one line at a time. Thank You.

\$\endgroup\$
3
  • \$\begingroup\$ Not to be annoying, but seriously - PACMAN wouldnt take an hour to write down in a Spreadsheet if your tiles are "visible". \$\endgroup\$ Commented Nov 14, 2010 at 17:23
  • \$\begingroup\$ @BerggreenDK : can you explain,please? \$\endgroup\$
    – Vishnu
    Commented Nov 16, 2010 at 4:29
  • \$\begingroup\$ Did you see my answer yet? \$\endgroup\$ Commented Nov 20, 2010 at 2:38

4 Answers 4

1
\$\begingroup\$

First of all there are a bunch of tutorials on Google regarding building Pac-man clones in eg. Flash. Some of these explain the idea pretty well. There is also a site telling the story and ruleset of the original Pacman ghosts AI. Will see if I can find that link again someday.

But regarding your question.

First of all you need to know your "maximum size" of your levels. In PacMan (from now on "PM" only) the maze is of a certain size, but this wouldnt be too hard to change later though - its only for the principles.

A 2D maze can be implemented with ARRAY's 2 dimensional arrays are just large strings of data.

I will try to show it with characters here:

XXXXXXXXXX
X...X....X
X.X.X.XX.X
X.X...X..X
X.X.X.XX.X
X...X....X
XXXXXXXXXX

Now thats not a pretty reprecentation of the actual PM, but enough for my point. What I can do now is to store these within a simple array/list of strings.

As you havent told us what programming language you will be using, I will just try to use some "pseudo kinda description" (javascript/actionscript/C# kinda )

var maze string[10]; 

maze[0] = "XXXXXXXXXX";
maze[1] = "X...X....X";
maze[2] = "X.X.X.XX.X";
maze[3] = "X.X...X..X";
maze[4] = "X.X.X.XX.X";
maze[5] = "X...X....X";
maze[6] = "XXXXXXXXXX";

From this I can find out where the walls are. I can use this for collision detection, I can use it for pathfinding and I can use it to draw the actual map.

You just make a function that will return what kinda "tile" is on a certain coordinate.

tiletype GetTile(xcoord:int, ycoord:int)
{
   return substring(maze[ycoord], xcoord,1);    // returns a substring (string, starting at xcoord, length)
}

You could also make it more "specific" if you want.

boolean isWall(xcoord:int, ycoord:int)
{
   return (substring(maze[ycoord], xcoord,1) == "x") 
}

Does this make sense?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Thankyou for your explanation.I'm marking your answer as correct. \$\endgroup\$
    – Vishnu
    Commented Nov 20, 2010 at 14:05
  • \$\begingroup\$ @Vish Great thanks, but keep asking if you have more questions. Game development and algorithm crushing is my favorite hobby. \$\endgroup\$ Commented Nov 20, 2010 at 17:00
  • \$\begingroup\$ LOL! just found this link: thetoolsmiths.org/2009/02/24/sweating-the-small-stuff \$\endgroup\$ Commented Nov 21, 2010 at 5:37
6
\$\begingroup\$
  • Tiled is a cross platform and quite powerful tile-editor.
  • Ogmo Editor is implemented in Flash (Adobe AIR), simple but good enough for most tasks.
\$\endgroup\$
2
  • \$\begingroup\$ actually i need a matrix out of the tiled representation, went through both of these and I could'nt get what I wanted. \$\endgroup\$
    – Vishnu
    Commented Sep 21, 2010 at 10:01
  • \$\begingroup\$ Not sure what you mean by that. Do you mean a matrix with tile-indices? Look at the output generated by OGMO Editor here: mattmakesgames.com/OgmoEditor/help/getting_started/index.html#4 looks like a nice matrix to me? \$\endgroup\$
    – bummzack
    Commented Sep 21, 2010 at 12:17
1
\$\begingroup\$

Mappy is another one. There's a plugin for mappy that exports maps in a format that is ready for flixel (a very well known game engine for Flash)

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

Dame- Deadly Alien Map Editor. Looks very slick, although I haven't tried it myself yet. It gets high ratings on the flixel boards.

\$\endgroup\$

You must log in to answer this question.

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