You are on page 1of 2

Scene 1:

onSelfEvent (load) {
ballspeedx = 10;
ballspeedy = 10;
}

onSelfEvent (enterFrame) {

// Collision Tests
if(ball.hitTest(left) || ball.hitTest (rigth)) {
ballspeedx *= -1;
}
if(ball.hitTest (user_pal) || ball.hitTest (top_pal)) {
ballspeedy *= -1;

}
if(ball.hitTest (bottom) || ball.hitTest(top)) {
stop();
}

ball._x += ballspeedx;
ball._y += ballspeedy;

if (ball._y <= user_pal._y * 2/3) {


if (ball._x > top_pal._x) {
top_pal._x+=13;
} else {
top_pal._x-=13;
}
}
}

User_pal:
onSelfEvent (load) {
startDragLocked(1,600,386,386);
mouse.hide(true);
}

You might also like