Ping Pong animation bug when setting anim speed

0 favourites
  • 5 posts
From the Asset Store
High quality sound effect pack, in the following categories: hand, net slide, racket, table, table slide.
  • Link to .capx file (required!):

    mediafire.com

    Steps to reproduce:

    The capx only has one sprite, called S1, which has 8 frames and has 8direction behavior, setting only to be able to move left and right.

    In the event sheet, I simply have:

    • Every tick: S1: set animation speed of this sprite to S1.8diection.Speed/30.

    S1 has two animations: Default and pingpong. Both are identical, except having Ping Pong feature on or off.

    Observed result:

    Setting animation speed seems to cause ping pong feature to reset its state to "non-reversal". This will cause the animation sprite to stuck in the last few frames, instead of going back and forth. (run the .capx, try move left and right until you see frame 6-7 and you will see what I mean)

    Expected result:

    Setting animation speed should not interrupt ping pong feature.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Win7 64 bits

    Construct 2 version:

    r152 64 bits

  • The problem is that if you manually set the animation speed, it'll take positive values as a "forward speed" and negative values as a "backward speed". I'm not sure if this is a bug though..

  • Ahh... so if that's really the true intention of the developer, for the feature to be coded that way, then it won't be a bug.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But this means, we will have to keep track of the backward/forward in the events ourselves.

  • Yeah, as it is it's not a bug because positive animation speeds mean to play forwards, so you're always forcing it to play forwards. However I did notice there isn't any way to tell if the animation is playing backwards, since the AnimationSpeed expression is still positive even when it's playing backwards. This is inconsistent with the action so is fixed for the next build (AnimationSpeed can be negative). With that fix, you can work around it by setting a positive speed if the current animation speed is also positive, otherwise a negative speed.

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