Staying on a line
Tndrstruck
Member Posts: 2
Hi guys,
Im rather new to GS, and still testing out what the engine can do. One of the things im testing out is how to move an actor along a set of lines. Like in this game http://www.tcksoft.co.uk/downloads/remakes/cobex-cruising-on-broadway-extra/
I am able to make it do that, sort of... I cant figure out how to make the actor stay in the middle of the line, and stop when there is no more line or a corner. My actor seem to want to move another 30 pixels before it stops.
Cheers
Im rather new to GS, and still testing out what the engine can do. One of the things im testing out is how to move an actor along a set of lines. Like in this game http://www.tcksoft.co.uk/downloads/remakes/cobex-cruising-on-broadway-extra/
I am able to make it do that, sort of... I cant figure out how to make the actor stay in the middle of the line, and stop when there is no more line or a corner. My actor seem to want to move another 30 pixels before it stops.
Cheers
Best Answer
-
tatiang Posts: 11,949Getting warmer... I added a condition so that the horizontal lines only constrain the player when the player is not colliding with a vertical line (and vice versa for vertical lines).
http://dl.dropbox.com/u/19602014/COBEX Clone v0.2.zipNew to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
Gonna see if I can make a quick demo for you to answer the rest of your question...
Okay, here's a start: http://dl.dropbox.com/u/19602014/COBEX Clone.zip. You can place the player actor on either line and it will center and constrain to the line's ends. But if you move to the corner, you are colliding with both lines and that's where my rules fail you. Like I said, it's a start!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User