Scene_Actors Create Actor on Layer

Description: 
create actors on on layers. This is useful if the scene have multiple layer and TO prevent some mass eg, monsters buried in the path in a tower defense game, or a loot is always on top of the player. The higher the layer ID, the more front the actor will be. 

Snippet (design mode)

preview code or code mode :
Script.createRecycledActorOnLayer(getActorType(13), 0, 0, engine.getLayerById(0));    

computational shortcuts
Extracted from com > stencyl >  behavior > Script.hx 
var a: Actor = Engine.engine.getRecycledActorOfTypeOnLayer(Script.getActorType(13),0,0,0); 
Script.lastCreatedActor = a;

No comments:

Post a Comment