Ultimate Gear War
Join the alien war, prepare your gear and protect your base at all cost!
4.18 / 5.00 15,863 ViewsHello everyone
First of all I want you to Know I'm italian so, please forgive my english,...
now..I've got a problem, I am approaching to flash games developement and I already have an idea on how hard it can be..I was trying to make a platform game,nothing special just to get used with flash cs6 and i'm creating my own 8-bit sprites with illustrator...what is driving me crazy are maps...I don't know if there are some tile map creators online or somthing like that, but please if you have any suggestion on how to create game levels(maps) or if you can tell me if there are any "easy to use" programs, I would really appreciate...you know it's always been a dream for me to create games since I can really say I grew up with them :D Grazie mille!!
You don't need a tile editor to create a tile-based game. If you want a 2D tile-based environment you need to know about multidimensional arrays, loops and nested loops at least.
First to "draw" your map you need to create an array containing multiple numers which mean some type of tile, for example, 0 is green tile, 1 is yellow tile.
var map:Array = [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0]]; At 1/25/13 08:55 PM, Spysociety wrote: var map:Array = [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0]];
the multidimensional array is good, but it can be reduced to a single-dimensional vector, increasing the lookup speed by quite a bit.
private function coordsToArray(x:uint, y:uint):uint {
return _map[(y * _mapWidth) + x];
}
private function arrayToCoords(position:uint):Point {
return new Point(Math.floor(position / _mapWidth), position % _mapWidth);
} Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P
At 1/25/13 09:38 PM, egg82 wrote: private function arrayToCoords(position:uint):Point {
return new Point(Math.floor(position / _mapWidth), position % _mapWidth);
}
private function arrayToCoords(position:uint):Point {
return new Point(position % _mapWidth, Math.floor(position / _mapWidth));
}
Point works in x, y - not y, x. Herp.
Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P
thanks a lot this should help! I guess I have to study more AS language...I used to create ground in illustrator and then put code on it...