Game Development Community

Question: SideScroller Flip Player Direction for Movement

by Will Smith · in Torque Game Engine Advanced · 04/16/2007 (3:14 pm) · 1 replies

Hello Everyone,

I'm making a basic sidescroller, and I have a question.
I have the camera setup viewing the side of the model, I have restricted movement on the X access(i just want the player to move forward and back) and everything is looking nice.


when I have my character move right he moves forward on the screen ---------->
and when I push the back key and he moves left on the screen but he just walks backwards.. which is default in TGE :(

I'm trying to figure out how I can go about flipping the model so when I push back he actually turns around and faces left and then walks toward to the left side of the screen.

Then of course I would need pushing forward to flip him back to face right and move right on the screen.

I'm not asking for someone to do it for me :) but if anyone could offer some insight it would be greatly appreciated.

Also would this be something that could be scripted? or would it need to be coded into player.cpp

#1
04/17/2007 (6:09 pm)
Use the search feature and look for a camera-relative movement resource, it'll do what you want.