How to make the "camera" follow an object?

Apr 27, 2008 at 6:01 PM
We are creating a simple 2d game and we have 1 problem which is fixed screen.

Please tell us if it is possible to make some kind of "camera" follow the player on the screen.

We have no idea how to apply a camera ( if it exists)

I know that it is a bit noobish but it is firs time we are using xna or farseer...
Apr 27, 2008 at 6:15 PM
The way i do it is to move everything but the character, this creates the illusion of a camera following the player, without the player actually moving.
Apr 29, 2008 at 8:39 PM
That would be more an XNA question then Farseer. You could probably find some help on the XNA forums.
Apr 29, 2008 at 10:54 PM
Thanks for all guys ^^

We managed to do it somehow using object position reference in draw method ( like canvas in Java AWT )
Jul 19, 2008 at 12:33 PM

Ive found a way to do this sort of thing in BlitzMax... Ill probably Upload a tutorial to the Unofficial Wiki later but you would do it like this:


Local Pos:Vector2 = Box.GetPosition()

SetOrigin(0 - Pos.X, 0)


This makes the "Camera" follow the object called Box (I know this is an old thread, Just wanted to tell people who are using the blitzmax version)