0 Favourites

Moving Platform physics

  • Going off the patrol method provided for me, I was also able to make moving platforms.

    Unfortunately, the platforms that move up and down seem to do strange things to my character when he's on them. Currently the platforms that go up and down go like this:

    -Patrol = 1 (my variable to tell what part of the journey they are in)

    -MovingPlat.Y < Origin + Distance (I use a local variable for the distance and the origin. Origin is set at the start of the layout and the distance is set by me depending on what part of the layout it is in.)

    -- Set MovingPlat.Y + 5 pixels

    -Patrol = 1

    -MovingPlat.Y >= Origin + Distance

    --Set Patrol = 0

    -Patrol = 0

    -Moving Platform.Y > Origin

    --Set Y MovingPlat.Y -5 pixels

    -Patrol = 0

    -MovingPlat.Y = Origin

    --Set Patrol = 1

    On the downward, my character bounces (I don't mind this so much. I realize it's just the sprite catching up to the solid moving platform). However, on the upward, my character slides fairly quickly to the left and unless you keep running right, the platform flings you from it. Is there a way to make platforms sticky?

    It is also worth mentioning that I use an invisible marker for my camera. Instead of having my players guess what is coming up next, I have a marker that the camera scrolls to constantly that slowly breaks ahead of the character as he's running up to a certain point and then matches his speed. The Y is always set to the character, and the keyboard controls the movement of the character and the invisible marker is controlled based on what the character is doing. The marker is not solid, its only behavior is the scroll to and it's only mention in my event sheets is in its place in relation to the character sprite.

    It might have nothing to do with it, but I'm finding the less I assume, the better others can help me <img src="smileys/smiley5.gif" border="0" align="middle" />

    EDIT: Also, if some one has a more refined method for having the window shift in relation to which way the player is moving, please do share :)

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,257
FlyingRam's avatar
FlyingRam
Unread hot topic
0 Favourites
[BEHAVIOR] Chipmunk Physics
673 82,493
nelostic's avatar
nelostic
Unread hot topic
564 105,204
rexrainbow's avatar
rexrainbow