How do I get a shadow to follow appropriately while jumping

  • I'm working on a top-down RPG and want to include jumping. Any tips?

    -I have a synthetic jump command that works well to get the character with 1 pixel of the initial Y position of the jump, but I could use help with the equation for positioning the shadow so that it follows your character at the right position "on the ground."

    There’s probably an easier way to do it, but here are the instance variables that I am currently using:

    IsJumping variable: 0 for on the ground, 1 for jumping, initial set to 0

    InitialVelocity: sets the strength of the jump, initial set to 0

    Gravity: every 0.016 seconds, add 0.04 to Gravity, initial set to 0 

    VectorY: InitialVelocity-Gravity

    ...and sequence on the event sheet:

    -Press space bar:

    set initial velocity to 1,

    set IsJumping to 1

    -IsJumping = 1:

    Set CharacterY to Character.Y+Character.VectorY

    -Gravity is > 2*InitialVelocity

    Wait 0.032 seconds (Got this number from some trial and error, but I guess it might be taking the sequence of the ticks into account)

    Set IsJumping to 0

    Set Gravity to 0

    Set Character.Y to Character.Y

  • Try Construct 3

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

    Try 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)