Suggestions for Tile Map Editor for Role Playing Game

  • Thread starter Thread starter Alex Gray
  • Start date Start date
A

Alex Gray

Hi,

I'm trying to create Map Editor for 2D role playing game and i'm
trying to decide what is the best way to do this. At first i thought
i'd do something like this: (for a 100x100 map)
for (int x = 0; x<100;x++)
for (int y = 0; y<100;y++)
{
System.Console.WriteLine(x.ToString()+"+"+y.ToString());

PictureBox cell = new PictureBox();
cell.Parent = this;
cell.Size = new Size(20,20);
cell.BorderStyle = BorderStyle.FixedSingle;
cell.BackColor = Color.PowderBlue;
cell.Location = new Point(x*20,y*20);
}
But it takes way to long to start up. I'm essentially trying to make
an Excel worksheet, but each cell will contain a small bitmap (no
text).
Any Ideas?
-alex-
 
But it takes way to long to start up. I'm essentially trying to make
an Excel worksheet, but each cell will contain a small bitmap (no
text).

Not possible that way, at least not with acceptable performance.
You'll have to write a tile-based graphics engine for your game first,
and then run the editor based on that engine. (That is: just one big
Panel control or whatever, you draw all the tiles yourself.)
 
Not to mention the fact that you'll have some memory issues because you're
creating 10000 picture box controls. To expand Cristoph's suggestion, I
would create a Tile class to handle drawing the tile on your surface (i.e. a
Panel control or something) and use a Flyweight design pattern to minimize
the number of concurrent objects.

Eric
 
Back
Top