Patrolling enemy
by Apurva Amin · in Torque Game Builder · 08/23/2006 (8:41 am) · 5 replies
Hi,
I didn't get any suggestions on my code for my previous thread, so I thought I might be going about things the wrong way. Basically, I have enemies that patrol a simple zone (left to right, or up and down). This is done by setting the velocity and setting the object response mode to "bounce". This works fine. However, when the level is rotated 90 degrees I need to have the enemy rotate with it and patrol the same zone. Since it rotates 90 degrees, if it was moving horizontally, it would start patrolling vertically since the level has turned. What would be the best way to go about doing this and ensuring the enemy stays in its patrol zone?
Thanks
edit: Or is there a way to rotate the entire scenegraph and/or specific layers?
I didn't get any suggestions on my code for my previous thread, so I thought I might be going about things the wrong way. Basically, I have enemies that patrol a simple zone (left to right, or up and down). This is done by setting the velocity and setting the object response mode to "bounce". This works fine. However, when the level is rotated 90 degrees I need to have the enemy rotate with it and patrol the same zone. Since it rotates 90 degrees, if it was moving horizontally, it would start patrolling vertically since the level has turned. What would be the best way to go about doing this and ensuring the enemy stays in its patrol zone?
Thanks
edit: Or is there a way to rotate the entire scenegraph and/or specific layers?
About the author
#2
How do I rotate the camera? I've looked for various commands and couldn't find a way.
Thanks.
08/25/2006 (6:49 am)
At the moment I've tried using rotateTo and setAngular Velocity, but neither work. The map is rotated, and the enemy is mounted to it. It then rotates with it and is then dismounted. If I don't dismount, then the enemy stays where it should, and doesn't offset. However, if I dismount it, it moves across slightly. How do I rotate the camera? I've looked for various commands and couldn't find a way.
Thanks.
#3
08/25/2006 (9:58 am)
AFAIK there isn't currently a way to rotate the camera. I'm crossing my fingers that camera rotations/flipping will be included in a not too distant release.
#4
www.garagegames.com/mg/forums/result.thread.php?qt=29015
08/25/2006 (10:44 am)
There was a source change posted a while back for rotating the camera, it was very simple to add, but I haven't tried it in the latest versions of TGB.www.garagegames.com/mg/forums/result.thread.php?qt=29015
#5
08/25/2006 (10:53 am)
Thanks Ezra, I'll try and see if that does the job. Hopefully there is an official fix though as the ability to rotate the camera would be very welcome :).
Torque Owner Stephen Howe
you could also change their speed from x to y (or vise versa).
Or rotate the camera to make it look like the world rotated?