Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
0
Members

Tips for wait animations/transitions to end.

A topic by KibaTenshi created Apr 18, 2018 Views: 304 Replies: 2
Viewing posts 1 to 2

I wonder how to "wait()" ms meanwhile a fade effect/animation/cutscene/ ends.


Example:  in a 2d plataformer if your character fall in hole and dies, this "actor" got teleported to the start zone, but i want a transition of fade during this warp.

What i achieve right now is my character warping and the fade effect comming just after the warp.

So, can i wait ms or wait frames of the update() or something like that?


Thanks in Advance!<33

Yep, im 24 and my english isnt good enough, sorry ;/

Hiya!

It sounds like what you'd want is to have one of the actors watch the fields of another. You can use `Sup.getActor("SomeActorName").getBehavior(SomeBehaviorName)` to access the fields of another actor's behavior. This way you can track the progress of the transition animation from another behavior.

Alternatively you could have a counter tick up on the update loop that only ticks up once the level transition has been kicked off, and once the counter is equal to your desired time, it transitions. Update() happens at APPROXIMATELY 60 times a second (it's different if the game is laggy or whatever). So you can just have the counter tick up number_of_seconds_you_want*60 to "wait" that many seconds.

You can also get a bit more precision with javascripts built in Date.now(). I'd do some googling to learn more about that.

There's no way to do async waiting like you're describing, at least not that I'm aware of. As far as I know, everything in the user-space for Superpowers is on one thread.

Hope that helps!

(+1)

Hey! Hi again @notexplosive! XD

"You can use `Sup.getActor("SomeActorName").getBehavior(SomeBehaviorName)"

i notice that the other day! and works perfect! 


P.D: i still triying to perform a better way for slopes!! XD

Ty 4 your answers!! <3