-
Sagging bridge
Let's say you have a bridge in a side-scrolling game that's made up of multiple adjacent active objects. How can you make the bridge lower a bit in the spot where your character is standing? Check the video below to get an idea of what i'm talking about
http://www.youtube.com/watch?v=b16upFloYak&t=3m17s
Thanks in advance
-
You could have a flag on the active that says if it's stepped on or not, if it's stepped on it increases Y of active by 1(or whatever you choose) but only once when action loops. Then when it is no longer stepped on, it goes back up.
-
1 Attachment(s)
Maybe I'm not understanding your explanation right but I don't think that will solve my problem.
Attachment 6600
The two ends of the bridge should always remain in the same place, the part the character is standing on should be the lowest part, and the parts in between should adjust to smoothly connect those points.
The bridge is basically similar to a tightrope actually.
-
I think this is what you're looking for. It's on Marv's MMF example site. Under Examples 2, MMF Examples O-P mid way down. (Physics Engine) Uses the Box2d extension and it has a bridge.
http://www.castles-of-britain.com/mmf2examples.htm
-
Thanks, that pretty much is the type of bridge I'm looking for. I'd like to do it without having to use box2D though if possible. If anyone else has an ideas it would be greatly appreciated.
-
How do you intend it to look and act if it doesn't use Box2D?
-
He probably just wants the blocks closer to the centre of the bridge to move down more than those on the edges (as well as influencing the vertical position of all the blocks on the bridge). I'm sure that can be done without box2d.
-
I would imagine you can just have actives that check their x distance from the player's x distance and then push down accordingly. So if the x of the object is close to the x of the player, it gets pushed down to maximum... farther away... less.
-
1 Attachment(s)
I made a quick and sloppy example... Obviously this isn't the cleanest looking example but it gets the point across.
-