Flow > Time > Do later

 Introduction 
All aimnations in games uses timing to render. ans some temporary effects and cooldowns. 
requires: import com.stencyl.behavior.TimedTask which is included in Design mode and code mode by default. 

Other potential uses
bypassing the use of Always or whenUpdatedListeners  

Snippet in Design mode

Preview code
runLater(1000 * 0.02, function(timeTask:TimedTask):Void
{
}, actor);

Code without import com.stencyl.behavior.Script
Script.runLater(20function(timeTask:TimedTask):Void
{
}, actor);

Computational shortcut level 1
var t:TimedTask = new TimedTask(your_function_here,20, false, actor);
Engine.engine.addTask(t);

No comments:

Post a Comment