Basic 2D game "camera" question

Hello there,

I’ve been experimenting to create a simple platform thingy. It’s solely to practise in actionscript, so it isn’t going to be something spectacular.

Everything going well so far except for camera control. I want the character to always be in the center of the screen. only when the side boundaries are reached, the character should leave the center of the screen to be able to reach the sides of the screen.
Somewhat like this: http://oos.moxiecode.com/examples/bombman/index.html

I’ve tried 2 ways but both without succes:

  • move the character using the keyboard, but somehow keep it in the center of the screen (have no idea on this one)
  • move the entire area except the character to simulate movement.
    This seems kind of ineffeciant but it worked out better that the previous attempt, the only problem is that the character doesn’t return to the center of the screen when he leaves the boundary.

The .fla’s are available for download here
http://stap.iam.hva.nl/~wullem01/platform experiment.zip

the actionscript is all in the first frame.
try not to be too hard on the crappy visuals :stuck_out_tongue:
Ignore the comments too, theyre only there to help me understand what I did.
The boundaries seem to be a bit sketchy aswell when moving to the sides, but that’s not a big problem right now.

I know it’s somewhat simple but it would help to improve my understanding in actionscript alot.
Thanks in advance