Tap screen to move (screenshot provided)

I am having some issues with my coding. I want the character to animate as if climbing a ladder when the player taps the screen. If they arent tapping the screen then nothing should happen. Here is what I have so far, but it isnt working correctly. When i tap the screen (or click, for testing) the player responds at random times. Sometimes it animates once or might not animate at all.

In the screenshot, the left side shows my game attributes, rule called "User taps screen" is in the tap screen actor (not seen on screen). The other rule " tap screen to animate character" is in the player actor.

Comments

  • SummationSummation Member, PRO Posts: 476
    edited April 2015

    @GamingtilDawn said:
    I am having some issues with my coding. I want the character to animate as if climbing a ladder when the player taps the screen. If they arent tapping the screen then nothing should happen. Here is what I have so far, but it isnt working correctly. When i tap the screen (or click, for testing) the player responds at random times. Sometimes it animates once or might not animate at all.

    In the screenshot, the left side shows my game attributes, rule called "User taps screen" is in the tap screen actor (not seen on screen). The other rule " tap screen to animate character" is in the player actor.

    [image]

    The way you have it set up it looks like you would have to hold the mouse button down in order to fire the animate behavior.

  • ArmellineArmelline Member, PRO Posts: 5,369

    @Summation said:
    The way you have it set up it looks like you would have to hold the mouse button down in order to fire the animate behavior.

    Yes, the moment you release the button, the "tapped" attribute is flagged as false. You may want to try setting it to true with mouse down, and set it to false using a timer that triggers the "change attribute tapped to false" once the animation has completed.

  • GamingtilDawnGamingtilDawn Member Posts: 104

    Thanks @Summation that is how I have it setup, didn't realize that. @Armelline im not sure how to let it know the animation has ended.

  • ArmellineArmelline Member, PRO Posts: 5,369

    At 10fps, 2 frames will take 0.2s to complete. So put a timer in that says "After 0.2s".

Sign In or Register to comment.