How do I make beat em up jump?

0 favourites
  • 7 posts
From the Asset Store
Jump on candies, collect candies and earn score!!!
  • Hi, guys. I'm new with construct 2.

    I'm interested on beat em up developing with depth movement like the Simpsons or Teenage Mutant Ninja Turtles 4 players arcade-style.

    My player1 is moving, running and attacking correctly but I have problemas with the jump. Player has no behavior, is coded like this:

    if key left left: set player.x to player.x-movement

    if key left right set player.x to player.x+movement

    if key left up set player.y to player.y-movement

    if key left down set player.y to player.y+movement

    I don't know how to make the jump in this case with CS2. If I use the platform Behavior I have problemas because the whole area is the ground.

    Could anyone help me with this, please?

    Thanks

  • Hmm, what I'd do is create a jump animation. In each frame, the sprite is a little higher than the last one without you actually having to change it's coordinates manually in an event (of course, when it reaches the top, you make every frame a little lower than the last one). You can add a shadow to the 'floor' of your animation to tell the player at which point in the ground the player will land. Also, you will probably need to modify the bounding box of each frame to wrap around the actual body of the sprite (because if you use the same bounding box throughout the entire animation, enemies will still hit you as if you were on the ground and you won't be able to jump over obstacles either).

    I hope I made myself clear

  • Hi, monitz87. I have tried with a solid shadow with this logic:

    forever: set shadow.x to player.x

    forever if not jumping: set shadow.y to player.y

    The problem with this is I have no idea how to make a "manual jump" without using platform behavior. In other case I would use a repeat loop something like: "repeat X times coor Y-- and repeat X times corr Y ++" but I think CS2 can't put loops inside actions. I know about the logic but I'm new with construct so I have problems making some logic structures. Do you know how could I make this "manual jump"?

  • That's what I was trying to tell you. You create an animation in which the player jumps. Each frame of the animation has the player a little higher than the last one, until he reaches the top, then it goes the other way around.

    Something like this:

    Each drawing is a different frame of the same animation. The origin (image point 0) stays in the same spot so you can know where in the floor the player is, and you don't need to manually change the sprite's coordinates. When you want to jump, you simply play the animation.

  • I see, thanks.

    But I think construct 2 doesn't allow to move sprites position in animation, so I must icrease image sprite size on each jump frame. Isn't it?

  • yep, the sprite's size increases, but the collision polygon should still wrap the drawing, not the whole sprite. Also, the origin should be the same for the entire animation (I assume you have the origin on the floor)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I didn't know about the col polygon. So this is perfectly solved.

    Thanks a lot for your fast and effective help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)