Making sure this is a bug...

This forum is currently in read-only mode.
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • Hi everyone,

    heres a tiny example .cap of the bug in question:

    http://www.holymonkeystudio.com/projects/animbug.zip

    I'm working on a platformer game and have a rectangular object with platform behavior, and then the sprite for the character's animations always set to the same position and angle etc...

    For animations like falling and jumping, its ideal to create and set the animation so it plays the first few frames once, then loops the last few extreem frames.. in construct this is done by setting "loop to" to the number of the frist frame you want it to begin looping at once it reaches the end.

    This works great for jump,... IE: when platform behavior is jumping=set sprites animation to jump.

    HOWEVER, the same set-up and code for fall is broken! It NEVER displays the first few frames.

    I'm also seeing in more complex situations which include "on animation finished: set to another animation... the sprite in my game frequently SKIPS the fists animation entirely and goes right to the second animation as though its falsley detecting that the first animation has finished when it actually has only just been innitiated... has anyone else seen this as well?

    thanks,

    Mike

  • hey monkey

    I haven't worked much with platform behavior

    or animations, so there may be a better answer or a simpler solution

    but what I came up with is that the jumping animation is told to stop after it gets to 3

    when you change the animation to falling, it is still stopped

    so you need to instruct the animation to play

    also, set this event to "trigger once while true" (under system)

    this will keep it from looping the "play animation" command which would start your animation over and over, and make it look like it was stuck on the first frame:

    <img src="http://files.getdropbox.com/u/1013446/New%20folder%20%282%29/Capture7.PNG">

    edit :

    the screenshot method I showed here works, but

    I messed around some more

    and maybe I just don't get it, but having loop on doesn't seem to cancel out the repeat to number

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • unfortunately, it JUMPS immediately to the last frame, it does not stick on the first. And what I'm trying to do works perfectly with JUMP, yet seems to be clearly broken with FALL. (even though its the same exact animation set up and "code"

    Also, If you run the cap after the change you suggested, you will see that it is still broken... notice that when the player falls, the fall animation playes ONLY the 3rd frame. (presumibly because the animation is set to "loop to" frame 3. HOWEVER, just as with the properly working jumping animation, it SHOULD play the first two frames of fall first, then loop on the third frame.

    Why does it behave properly with jump, but not fall?

  • Lucid's method should work, but not exactly for the reason he stated.

    Think of your frame number as "global" for your sprite. If you are on frame 8 of your Run animation, and you switch to the Walk animation, then you will still be on frame 8. If you want to change to a different frame, you need to specify.

    The Play Animation action starts the animation over again from frame 1 (whereas the Resume Animation action continues a paused animation from it's current frame).

    So this should work:

    <img src="http://files.getdropbox.com/u/1013446/New%20folder%20%282%29/Capture7.PNG">

    And in fact, I have your .cap open right now and I've changed the event to look exactly like this and it does indeed work for me.

    Why does it behave properly with jump, but not fall?

    Because you have only one frame for your Default animation. So when you switch to Jump, you're on frame one.

    Just keep in mind that the animation frame number carries over when you switch and you'll be fine.

  • Terribly sorry for not reading your suggestion more carefully Lucid and thanks both of you for taking the time to help me out. I've made the changes and it now seems to be working perfectly.

  • no problem, buddy

    glad it's working

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