Orbit only works clockwise -- why not counter clockwise?

From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.

    I've tried to come up with a formula to adjust the sprites angle while it turns, so that i don't have to rely on setting Match Rotation.

    But, as i suspected, it non-trivial to work this out -- so, far I haven't managed -- i've tried a formula that uses some kind of atan and also looked at how the sprites rotation could be translated into an angle.

    I now got the code to work using set mirrored action -- however, quite like my earlier work around -- where I set a flipped frame, to rectify the flipped image -- the set mirrored is visually noticeable by making the sprite blink.

    That's just a normal consequence of the 'Set mirrored' action. Even if the behavior controlled that for you, it'd still work like that.

    'Set mirrored' is a shorthand for setting a negative width. The reason we don't make behaviors control the mirroring is it effectively means the behavior then controls the object size. This could then conflict with any other actions or behaviors that also aim to adjust the object size. So by leaving this to your event sheets, you remain in control of how the object size is managed.

    Behaviors are really just to simplify some basic calculations and gameplay mechanics. Most behaviors can be replicated in events, and if you need to customise them beyond what the behavior provides, you can and should use events instead. This is an intentional design decision of Construct.

    Hi Ashley,

    Many thanks again for your response.

    Truefully, I don't understand.

    I don't want to use set mirror nor suffer the consequences of its use -- since its merely a workaround.

    What is needed is to simply have correct image behavior for counter clock wise orbit, with Match Rotation set -- no flipping -- the sprite actually should move counter clockwise, in a forward direction (i.e. positive speed).

    In my mind this is really simple and straightforward requirement -- yet, i am struggling with this already for a week to get something like this to work on the event sheet, simply to replicate straightforward behavior.

    Clearly, this can't be the intention by design.

    What effort would it be to create an official counter-clock orbit plugin a clone of clock-wise orbit.

    That then behaves correctly for positive speeds, and matched rotation, while turning counter clockwise.

    No need for negative speeds, no need to break already existing behavior that expects negative speed, elsewhere. No need for mirror or frame workarounds that don't actually work, visually. And no need to force developers to vector and circular math for something that essentially already exists as behavior in the clockwise direction -- which makes this even more frustrating.

    And, hence, no need to let customers struggle with something that should really be trivial.

    It would be great if you could offer that.

    Dan

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    The sprite angle is just Sprite.Orbit.Rotation + 90 when going clockwise, and Sprite.Orbit.Rotation - 90 when going counter-clockwise. It's as easy as that.

    Thank you for letting me know- - i will give it a try.

    Thank you Ashley,

    Luckily, it turns out to be even simpler to get match rotation to work with the event sheet.

    In my code example, which is based on the code dop2000 posted in a "parallel" thread, it works with car.angle = car.orbit.rotation, even omitting the +/-90, when the car orbiting state is enabled.

    Here is the attaching a link below:

    u.pcloud.link/publink/show

    If i may suggest, to add a short description (and perhaps example) of this workaround into the orbit documentation.

    It could save a lot time (and frustration) to someone else who has trouble hitting the simple solution of the orbit's rotation property to adjust angle during orbiting, as an alternative to match rotation, when sprite flipping with negative speed is a problem.

    thank you,

    Dan

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