okay, now a friend of mine is making a game in php that builds a map in GD
he is, a fast learner but is still new to coding
i helped him with the map, it builds the map by looking in a mysql table, it looks like this before it is drawn
0.1.0.0.0.0
0.1.0.0.0.0
0.1.1.0.1.1
0.1.1.0.1.0
0.1.1.1.1.0
0.0.0.0.0.0
0.0.0.0.0.0
then converts it to
$map[1] = 0;
$map[2] = 1;
$map[1] = 0;
$map[1] = 0;
pretty simple form there, but it will do
now much like in Civilisation games you can make units that walk around the map, but a pathfinding thing is beyond me and him combined
has anyone got any idea's at all for a way for a unit to get from point a to point b without walking through terrain it wouldnt normally be able to walk through (in this case, by walking only on the 1's)
any clues at all would help me and him a lot
now, as it is it just numbers each map peice up to 100000 or something (the map keeps growing)
i think it would be easier to have it in levels... like
$map[1][1] =
~
$map[1][1000] =
$map[2][1] =
~
etc
that way php could tell what level its on without all the maths
like,
$map[1][12] to $map[2][12] is going down one.... instead of
$map[12] to $map[1012]
anyway any ideas at all? clues, pointers to the right direction