Java Reference
In-Depth Information
var world = new World(new Vector2f(0,1200), 1);
for (node in nodeToReplace.content){
if (node instanceof Control){
var control:Control = node as Control;
var handler = ControlHandler{
control: control
}
insert handler into inactives;
insert handler into handlers;
world.add(handler.staticBody);
}
}
inactives = Sequences.shuffle(inactives) as ControlHandler[];
var addBodies = Timeline{
repeatCount: Timeline.INDEFINITE
keyFrames: KeyFrame{
time: .5s
action: function(){
if (sizeof inactives > 0){
var handler = inactives[0];
delete inactives[0];
handler.isStatic = false;
world.remove(handler.staticBody);
world.add(handler.body);
}
}
}
}
addBodies.play();
var worldUpdater = Timeline{
repeatCount: Timeline.INDEFINITE
keyFrames: KeyFrame{
time: 1.0/30.0*1s
action: function(){
world.<<step>>();
for (handler in handlers){
handler.update();
}
}
}
}
worldUpdater.play();
Search WWH ::




Custom Search