Game Development Community

Moving the player along a straight line

by Michael K. · in General Discussion · 05/09/2007 (11:04 am) · 3 replies

Hi!

I'm trying to get the player to move straight along the x axis.
The player should only be allowed to move forwards and backwards (even if he gets hit by an explosion for example).

Is there anyway to lock the movement axis of the player?

I tried creating a thin mission area and bumped the player back when armor::onleavemissionarea was triggered.
But then the player just shook the whole time :(

Thanks for any help!

#1
05/09/2007 (6:39 pm)
Ok, now i tried squishing the player between two large walls (with a NULL texture, so that the walls are transparent).
It works ok, but now the player casts a shadow on the walls which look pretty strange.

There must be a better way to do this....
#2
05/09/2007 (6:46 pm)
I see you are a TGE SDK owner.
if you really want the player to only ever move in one dimension,
there are a couple places in the engine where it would be easy to do.
re-post in the private TGE forums and i can go into more detail there.

you could also do it in script but it would not be as clean.
#3
05/09/2007 (11:17 pm)
This thread continues here:
http://www.garagegames.com/mg/forums/result.thread.php?qt=61930