Java Reference
In-Depth Information
visible: false
}
def scoreAnim = Timeline {
keyFrames: [
at (1s) {
score.scaleX => 3;
score.scaleY => 3;
score.opacity => 0.0;
score.visible => false
}
]
}
3. Next, we declare objects to display and animate the paddle on the screen.
def paddle: Rectangle = Rectangle {
x: 10 y: 10 width: 50 height: 10
fill: Color.BLUE stroke: Color.WHITE strokeWidth: 3
}
def paddleAnim = Timeline {
autoReverse: true
repeatCount: Timeline.INDEFINITE
keyFrames: [
KeyFrame{
time:paddleTime values:paddle.translateX => 350
}
]
}
paddleAnim.play();
4. Lastly, we declare the objects to display and animate the ball.
def ball:Circle = Circle {
radius: bind rad
centerX: bind cx;
centerY: bind cy;
fill: Color.RED
stroke: Color.WHITE
strokeWidth: 3
 
Search WWH ::




Custom Search