2D games technique

Hi people,I would like to know how to move the camera along the map while it's a 2D map, e.g. like StarCraft and Age of King. Am I moving the center of the screen to the map coordinate that my mouse pointed?Many thanks,Andy
[252 byte] By [hksdu2k] at [2007-9-27 22:36:33]
# 1

I cannot lead you to any ready sollutions and I wouldn't if I could.

You have to code it yourself.

The idea that I use for 2d tile maps is based on array, where the real numbers present type of the tile.

arrayw looks like this

{2,3,2,2,2,2,

2,3,3,3,3,2,

2,2,2,2,3,2}

where 2 is basic grass and 3 is road.

Obviously, this map is bigger than the screen so that this would work. You take the map and calculate how many tiles the screen can show and then decide where you read the array.

Now you draw all the tiles.

If you give me your e-mail I can send you a class which explains the drawing part in nutshell, its directly from Black art of Java Game programming(don't buy it, its not that good). Thats not hard, the hard part is to find a method to move the screen.

OlliPekka at 2007-7-7 13:22:18 > top of Java-index,Other Topics,Java Game Development...
# 2
jvp02@yahoo.com
javatypo at 2007-7-7 13:22:18 > top of Java-index,Other Topics,Java Game Development...