Changing Animations

0 favourites
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • .capx fileAnimation Test

    I'm having the following issues with this layout:

    1. When the character is crawling (down arrow + left or right arrow), the crawling animation doesn't play. Instead, only one frame of the crawling animation is displayed and the character appears to slide along on all fours. NOTE: This code block also changes the size of the player object.

    2. While crawling under the obstacle on the layout, if the player releases the down arrow, the character will become stuck. I'm sure it is because the player object changes size, by design, but I don't know how to fix this.

    3. When the player executes a forward flip (left or right arrow while falling to floor), the character animation should change to the running animation. Instead, the character freezes, and appears to skate along while standing upright.

    **UPDATE-CLARIFICATION** The animation will reset to the proper running animation when the player releases the arrow and allows the character to stop.

    **UPDATE-SOLVED (SORT OF)** I imported my running sprite sheet to the end of the flipping sprite sheet. I then set the new flipping sprite strip to repeat at the frame where the running begins. The effect is to make the character appear to flip and then continue running as originally envisioned.

    The revised .capx can be downloaded here: Revised Animation Test .Capx

    Bonus points: keep the animations from activating when flying (space bar) against the ceiling.

    Thanks,

    Tony

  • bonus..... write a system condition when object touching then combine with it write a stop animation action for the player

    2. write everytick system condition then combine with it a set object size action

    1. write a every 0.3 seconds system condition then write a player action start animation from beginning and set animation speed action of 50 for example

    3. increase animation speed of the player in actions

    set angle to angle of motion

  • i checked out your capex ...slow down the speed of the player when he is crawling by set speed action on player where you have the animation action

  • Thanks for the advice. Have you been able to get this to work? I have not.

    I wonder if this is a bug?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Still not working.

  • Only set the crouching animation if the player isn't crawling ie. when action = 0. Otherwise the animation is being set to crouch and then crawl every tick so the crawl animation keeps getting reset and you only ever see the first frame.

    For the flipping, use the 'On animation finished' trigger to change to the run animation.

    animationTestUpdate.capx

    *edit* I changed the origin point to the bottom of the animation. It stops the player 'jumping' when you change it's size

  • To prevent the player standing up inside a wall do something like:

    If the player is crawling and down is not pressed then

       change the player size to (39,126)

       if the player is not overlapping wall at offset 0,-1 then

          stand up... set animations etc..

       else

          set size back to (39,126) + stay crouching

  • Outstanding! Thank you. Sometimes you get so buried in the code blocks it's hard to step back and see the big picture.

    I truly believe this is the best community on the web.

    I found the 'On Animation Finished' condition yesterday, believe it or not. Thanks for showing me how to use it.

    When I have fixed the other issues I'll post the revised .capx here for C2 users, who find it useful, to implement in their own projects.

    Thanks again.

  • Funny, it looks like we're trying to do the exact same thing animation-wise, though your setup looks to be more state-driven :)

    I have all the same locomotion (my 'running land' doesn't flip' but it is unique from a stationary land) but I found this thread while trying to implement crouching and crawling.

    I see you are manually resize your player object but wouldn't it be a more flexible system if you were to make your crouch values a percentage of the original, standing size? The 'scale' property is looking for a percentage but height and width are looking for integers.

    I've searched around a bit but haven't been able to find an expression to set height or width to a percentage of their original. Any takers?

  • Have you been able to do this?

  • No, not yet. I've searched around and found references to a OriginalHeight and OriginalWidth parameter in Construct Classes but I haven't been able to get that to work on Construct 2. Quite possibly a syntax error but if anyone knows, I'd love to hear.

  • What do you think the advantage would be doing it the way you propose? Speed?

  • "To prevent the player standing up inside a wall do something like:

    If the player is crawling and down is not pressed then

       change the player size to (39,126)

       if the player is not overlapping wall at offset 0,-1 then

          stand up... set animations etc..

       else

          set size back to (39,126) + stay crouching"

    After spending many hours breaking my capx, I haven't been able to get this to work either. <img src="smileys/smiley5.gif" border="0" align="middle" />

  • I've searched around a bit but haven't been able to find an expression to set height or width to a percentage of their original. Any takers?

    I believe the only way it's to use a math formula.

  • You can download the sandBOX and learn how I solved this issue =]

    Plus, there have a lot of other poses. Feel free to use, it's not paid.

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