Sprite sleep

0 favourites
  • 6 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • 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 ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • sad realy thanks all 2

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