Sprite sleep

0 favourites
  • 6 posts
From the Asset Store
A set of 10 pixel art animated magic effects with icons. 2 Fire, 2 Earth, 2 Wind, 2 Water, Portal, Explosion.
  • Hi guys,

    I start create a platform game, i want know how can i set animation "sleep" before 5 seconds of player stopped use command.

    any can help me?

  • Hello,

    You use Touch, Mouse, or keybord ?

    However, use variable (named "Sleep" ?), then create function named "Start sleep timer".

    On "Start sleep timer" function -> Set Sleep to 0.

    Repeat 5 times -> Wait 1 second then add 1 to sleep.

    Condition : Sleep = 5 & Trigger Once -> Start your sleep.

    On touch, or clicked, ect -- > Call function "Start sleep timer".

  • Touch,

    Is first time i use function, so double click to layer - add function - Add aautomatic and rename to Start Sleep timer .. OK

    Repeat 5 times -> Wait 1 second then add 1 to sleep. <-- help ? add another codition to first or whatelse ?

  • In your character create a new Number Variable called Sleep TImer. Have it's default value at 0.

    Since your game is a touch game, I assume you have sprites that you have to hold to make your character move. You'll want to create a "If Touching Object "the area(s) you touch to move your character" and invert it, then create a sub-event of "Every 1 seconds, add 1 Character.SleepTimer". Then you'll need a "If SleepTimer = 5, set 'Sleep' animation" and a "If SleepTimer <5, set 'Idle' animation". You'll also need a "Is in Touch" with a sub-event "Every tick, set SleepTimer to 0".

    Bare in mind, I've never worked with Touch before so it may be wrong; but it seems like the general idea to follow.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sad realy thanks all 2

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