Hey guys whats up ?
I know this sux for now but whant to hear what you think. I used the tiles approach Ive been talking with FlashKat. and seems that she/he was right that it will slow down the game. I used arround 100 MC jeez thats alot. this will change. Use the spc bar to shoot stuff.
Strategie wich I used 4 tiles MC up down left and right.
hero moves in all dirs. by default
you have to step on tile and a direction will be disabled.
OK thats it.
I will change the approach and post new samples. Once I get it right will post the fla as well.
PS I was on a vacantion in Las Vegas. This place rocks guys.
Seems to me you could do this with a grid... Don't necessarily move the hero with the grid, but after every pixel or unit of movement:
(M = Number of pixels he moves with each iteration)
(X,Y = hero's location in pixels)
(G = width/height of one grid square)
If he's moving left:
Get the location of (X-M,Y)
Call a procedure to translate this to grid coordinates
gX = Int(((X-M) + (G/2)) / G) * G
gY = Int(((Y) + (G/2)) / G) * G
Check your grid to see if there's a barrier there.
If so, make him stop moving.
So you see, this approach will let you have a grid-based map (or multiple ones loaded from text files), but still have the hero move in 1-pixel (or whatever) increments.
Oh, and of course by a grid, I mean a 2D array... "grid_1_1" and the like... The grid values could be "0" for open space, "1" for a wall, "2" for a player or enemy, or anything you want... It's a pain to code, but it will run faster and more efficiently than having hundreds of MCs.
Sorry guys server wil be down for couple of days for update.
Xantor definately this is the way to go I thought that I can do it otherway arround.
It works preaty good for small mazes to tell you the trought. this one is big.
Listen Ill redo the maze tiles from variables see how this goes. though it is a pain here Xentor is right. Now Ill be using 0 and 1. for walk or not to walk. Now I was thinking to make a simple script to generate look up tables on the fly. I need cgi script ( FlashDB is perfect ).
Keep in touch.