Java Reference
In-Depth Information
world.clear();
delete worldNodes;
delete group.content;
}
public function run():Void{
var button0 = Button{
text: "Simple";
action: simpleBalls;
}
var button1 = Button{
text: "Falling Balls";
action: fallingBalls;
}
var button2 = Button{
text: "Pendulum";
action: pendulum;
}
var button3 = Button{
text: "Teeter Totter";
action: teetertotter;
}
var vbox = VBox{
translateX: 32;
translateY: 64;
spacing: 16
content: [button0,button1,button2,button3]
}
Stage {
title: "Chapter 6"
width: 640
height: 480
scene: Scene {
fill: Color.BLACK
content: [group, vbox]
}
}
worldUpdater.play();
}
function simpleBalls():Void{
reset();
addWorldNode(Ball{translateX: 320, translateY: 10});
addWorldNode(Wall{width: 100, height: 16, translateY: 200, translateX: 320, rotate:
30});
addWorldNode(Wall{width: 100, height: 16, translateY: 370, translateX: 430, rotate: -
30});
}
Search WWH ::




Custom Search