Game Development Community

Camera Movement

by Martyn · in Torque Game Builder · 09/18/2008 (4:13 am) · 2 replies

Hello,

I am making a basic casual game based of the Fish Game tutorial and I require the camera to move. But I do only want the camera to move downwards once the player moves down.

I have used the behavior to mount the camera to the player but this does also mopve the camera from side to side revealing level that has no design on :)

Does anyone know how I would get the camera to move down as the player does? or would I need to create the level as a scroller so that as the player moves down the level scrolls up?

Thank You

About the author

I have been interested in game development for around 10 years, it has always remained a hobby. I am now looking to develop my skills and maybe progress it from a hobby into a 2nd income.


#1
09/18/2008 (4:21 am)
This is just a guess, but I don't see a reason why it wouldn't work. If you mount the camera to the player, you should be able to set the view limit of the scenewindow to clamp the X values. For example:

%sceneWindow = sceneWindow2d;
%cameraSize  = %sceneWindow.getCurrentCameraSize();
%sceneWindow.setViewLimitOn(-%cameraSize.X / 2 SPC -1000 SPC %cameraSize.X / 2 SPC 1000);
#2
09/18/2008 (5:32 am)
Thank you - Ill get playing around :)