How do I continuosly show and not show a sprite

0 favourites
  • 2 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • hey folks

    i am a bit stuck....

    im trying to show a sprite for say 1 second, then have it not shown, then shown again for a second repeating for x times, then gradually start to reduce the time it is shown to less than a second and so on....



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello. The best way to show and hide the sprite would be to use the set visible action which "sets the object visible or invisible (hidden)." Measure the time with the dt expression (which gives you the amount of time in seconds since the last tick.) You can set up a variable and do a variable = variable + dt and than compare that variable to some given value, say 5 sec.

    To count the number of times the sprite is visible/invisible, use a counter variable (instsance variable or a global one) and increment it when the sprite is shown or hidden.

    For the gradual reduce of the time, the best way would be, in my opinion, to use some quadratic function of the counter variable mentioned above.

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