Java Reference
In-Depth Information
insert Main.offsetFromZero(screen.peg0) into pegs;
insert Main.offsetFromZero(screen.peg1) into pegs;
insert Main.offsetFromZero(screen.peg2) into pegs;
insert Main.offsetFromZero(screen.peg3) into pegs;
insert Main.offsetFromZero(screen.peg4) into pegs;
for (firework in (screen.fireworkGroup as Group).content){
insert Main.offsetFromZero(firework) into fireworks;
}
lightsAnim = Main.addLights(screen);
lightsAnim.play();
}
public function startingAnimationOver():Void{
Main.allowInput();
var startingAnimation = Timeline{
keyFrames: [
KeyFrame{
time: 10s
values: screen.startGameInstructions.opacity => 0.0 tween
Interpolator.SPLINE(1.00,0.00,1.00,0.00)
action: startRound;
}
]
}
startingAnimation.play();
}
function startRound():Void{
cannonAngle = -45;
world.clear();
clownsAvailable = 5;
for (peg in pegs){
peg.translateX = 100 + Main.random.nextInt(400);
peg.translateY = 100 + Main.random.nextInt(200);
var circleBody = StaticCircleBody{
node: peg;
}
world.add(circleBody.body);
}
//adding wall on right edge of screen
for (i in [0..40]){
var wall = new StaticBody(new net.phys2d.raw.shapes.Circle(12));
wall.setPosition(640+6, i*12);
world.add(wall);
}
readyLaunch();
}
Search WWH ::




Custom Search