Game Development Community

How Would I "Swivel" the Screen?

by Jay Jennings · in Torque Game Builder · 11/04/2009 (6:57 am) · 8 replies

Anyone who's played with a remote-control car knows the problem -- when the car is driving away from you steering is easy, but when you turn and start coming back your brain has to make a switch and reverse things. And that's when you crash into things (well, I do).

If I have a top-down view in a TGB game and want my player to always be facing forward, I need to swivel the world around him instead of making him turn. (Did I explain that correctly?)

It could turn out that I'd induce motion-sickness in the players and that wouldn't be a good thing, but if I wanted to try that am I in for a world of hurt? Mainly considering that I'd be redrawing everything on the screen because when the guy is moving, *everything* is also moving.

Can TGB do that? Swivel the screen around? What would I look at to get that effect?

Thanks.

Jay Jennings

PS - I may have answered my own question because something like TGB Kart Kit keeps your car facing in one direction while everything else turns -- just the perspective is different (not top-down). Still, is there an "easy" way in TGB to turn the screen?

About the author

Make my living writing and selling ecommerce tools -- but I'd rather be writing games (of course). My family of four lives in 208 square feet and we may be in YOUR town next week.


#1
11/04/2009 (2:50 pm)
So you basically want to have the camera rotate with the player?
#2
11/04/2009 (6:41 pm)
Yeah, that's what I'm looking for. I checked the Camera functions and while I can see how to move X/Y and zoom, I don't see anything like a rotate.

Jay Jennings

PS - Thanks, rotate was what I meant, not swivel. =:)
#3
11/04/2009 (9:00 pm)
EDIT: At first I was thinking TGE/A or T3D, but then I realized, I'm in the TGB forums!

Anyway, I believe you can getRotation(); the car, and then apply that to the camera. Remember to make the camera and car have onUpdate(); enabled.
#4
11/04/2009 (9:44 pm)
Camera rotation is not currently supported in TGB. Unfortunately there aren't many options other than actually coding up rotation yourself.

Maybe we'll just have to see what Torque 2D holds for us ;)
#5
11/04/2009 (10:32 pm)
Hmmm, okay, I'll forget that for now.

And it's quite possible that my current thinking is too complicated -- I'll do some more brainstorming about the interface and see what I can come up with.

Thanks.

Jay Jennings
#6
11/04/2009 (10:39 pm)
I've seen this wish before. And Yet It Moves actually does it (or makes it look like so). I'd keep an eye out for a T2D wish list thread, if GG decide to post one.
#7
11/06/2009 (5:59 am)
You could give the camera worldlimits to "help" but IDK if that would do much.
#8
11/06/2009 (2:46 pm)
it has been 3 or so years and still no camera rotation has been added after multiple requests, it is possible to do it through modifying the code though from what I remember, I'm not sure how much it differs with the current version of TGB:

Http://www.garagegames.com/mg/forums/result.thread.php?qt=29015