Game Development Community

Dynamic camera

by Andy S. · in Torque X 2D · 03/23/2009 (11:31 am) · 3 replies

Hi,

in my game I have two players, both animated sprites. The level is much bigger than the camera, so I want that the camera moves around with the players. If the two players go away from each other, I want the camera to zoom out, if they come close to each other, I want it to zoom in. Never should one of the two players not be visible by the camera.
I thought of having a blank scene object, and then mounting the camera to it. Still I don't know how to manage this behaviour I want with the zooming camera...I would appreciate any help on this.

Thanks,

andi

#1
03/23/2009 (4:48 pm)
I wrote some articles about this awhile ago: Camera Tracking with Multiple Players

I haven't done any camera zooming but you could easily add this by calculating the distance between the two players and then using this value to determine how far in or out the camera should be zoomed.

#2
03/24/2009 (1:13 pm)
Thansk Sean, this helped a lot ;-)
#3
03/24/2009 (1:28 pm)
Glad to hear! Let me know how you end doing the zoom feature.