sprite destroy after x second

  • Hi all,

    Is there a solution to set a life for sprite this means if i have many instance of sprite the oldest will be destroyed first...

    please give me solution it's urgent

    Thanks guys

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Give sprite a variable and do this:

    <img src="https://dl.dropbox.com/u/1024727/images/dt.PNG" border="0" />

    This will destroy Spriter once it's been alive for 1 second.

  • does 1 tick always = 1/60 of a second even on slow systems where the fps is 20 or 30?

  • Framerate/tickrate/FPS doesn't stay the same on every computer. Which is why you have to use "dt" in expressions so that your game is consistent.

    Ashley wrote about this.

  • thanks friends for your helps,

  • Another option is to use Fade, as discussed here: Destroy Sprite after X time

  • so if i use the Sine or Bullet behavious, it will not play the same on different computer with different fps?

    will i have to use *dt on all of the figures in Sine or Bullet?

  • Behaviours already use 'dt', so don't worry about them.

  • The Fade behavior is great for that, because you don't need any other events for it. Just set the wait time to whatever you want, and the rest to 0

  • Yeah I agree with 7Soul and BlackHornet above....I Just use the Fade Behavior..

    I used to wonder about this same function until I saw the Fade Behavior...

    Not only does it work perfectly, has 2 built in timer functions and you can do a gentle fade out function if you like also but it also has the Built in Destroy after Fade options..Pretty simple.. I Think its there for that single reason..Maybe someone could add that to the Manual ...

    Well spotted lads..and you beat my post to the line..Kudos!

    I think its unanimous now right...

    A very well designed built in Behavior.....

    Its good to see how versatile Construct 2 behaviors are...

    there is so much you can do with them if you play around some and be will ing to make mistakes...we all do....experimentation is the key!

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