How do I make Castlevania-style jump delays?

0 favourites
  • 4 posts
From the Asset Store
Single Track kit that includes wav files for the Beat, Lead, Sub and the MP3 loop.
  • In Castlevania, there is a small delay between when the player presses the jump button and when the character actually jumps. In this time (about 1/4th of a second), the character stops moving and does a small crouching animation. When the animation finishes, the character jumps.

    Now, in theory, all I would have to do is make it so that when the player presses the jump button, disable the platform behavior, wait .25 sec, then re-enable it and simulate jump. That works just fine, but the animation does not, and I can't figure out why.

    Here is my current code setup. You can see highlighted in the image that I have the pre-jump animation set before the wait (it does not repeat and has infinite length), but it doesn't play. Instead, the walking animation plays if you're moving before you hit Z or the standing animation if you're standing still.

    You can see that I also have set up a system for when the player lands AFTER a jump, and that works totally fine without issue, but I cannot figure out how to implement the reverse for stopping before the player jumps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just double posting to say never mind, I figured it out! All I had to do was make an exception to the 'set animation to run/stand' events that specified that the pre jump timer was at 0 or else they would not play, and then I was able to practically copy over the code I made for the landing. Sometimes a nice walk to clear your head does wonders!

  • About that walk, yes, it does. I usually only post on here when I can't figure something out on my own for hours of struggling.

    Sometimes the answer just pops into my head when I'm not even trying to think about it, such as in the shower or in a meeting at work. Figuring it out on your own is rewarding.

  • thats because you dident set the animation, to have same speed, when you open up you charachter animation in the c2 editor, each frame has a speed amount, and the animation has a repeat count, or speed animation play, if you have 12 frames in the animation you should play the animation at 24 frames per second, that will make it look natural, if you crouch animation is longer then 5 frames, then for each frame of the crouch you should make it so last 0.25 or 0.5 seconds, that will mean each frame of the crouch animation has to be 0.05 or 0.1 if you have the jump animation frames included in same animation

    or you could call the jump condition to happen if you have diferent animation lets say, you have crouch, and jump animation to trigger

    now when you press the jump button the first animation you want to play is the crouch

    so the code should be calling : when spacebar pressed set animation crouch, if frame is last frame in the crouch animation, set animation to jump , if frame is the 1st in the animation jump then trigger jump behavior! thats a easyer way to do it!

    if falling set animation to falling.

    if landed set animation to idle

    if player moves left or right set animation to the keys it moves (left right)

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