How do I make a "hit animation"

0 favourites
  • 7 posts
  • Well i have created the following little platformer.

    https://www.dropbox.com/s/wdc2fgr8regngd9/SimonJumping.capx

    Find the key. then find the lock to open the door.

    All i want (at the moment) is:

    If the Player falls into lava

    -change UI_life->Frame

    -make player jump up a little bit (maybe even flash him) (to notice he got hit(damage))

    -fall again.

    I hope it is clear what i mean.

    It's like Sonic the Hedgehog getting hit und getting knocked back... but i want the player to kinda jump.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, I have only ~a week on Construct, I don't know what do you refer with "-change UI_life->Frame", but:

    Player -> On collision with another Object -> Lava:

    • to make player jump a little: Player -> Set vector Y -> -300 (you can try a smaller or a bigger value, but it need to be negative)
    • to make player flash: add behavior "Flash" to player and then, Player -> Flash -> (select the duration, depends on how you like it)
    • fall again: he'll fall automatically, no need to change the vector again

    Hope I could help

    Edit:

    Oh, and add a System -> Wait -> (seconds), after the above events and before the System -> Restart Layout.

  • Perfect answer from cornelg7

    And here the capx after adding the events

  • ok that worked so far....

    but after jumping and falling he lands into lava but i want the player to fall out of screen... (through the solid rocks under the lava)

  • add an action to disable collisions on the rock..

  • Oh yeah simple idea

    but then all my enemies fall down as well but i dont want that.....

  • A0Nasser already put a new action there, Player -> Set collision enabled -> Disable, that is disabling any collision with the player and he fall through anything...

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