Objective of this game:
- Holder should pick a new tower ball and start to swing
- Holder should place the ball on the selected location
- Again a new ball will be generated and started swing. If the recent ball placed on the line of the previous ball, the ball is on the stack or it will fall down from the stack.
- The score is based on the exact location of the recent ball with the last ball placed on the stack.
rope_mc.rotation=Math.atan2(rope_mc.x-xSpeed,ySpeed)*90/Math.PI;
to make it swing, I am multiplying the speed with -1 on each swing like,
if (holderStatus=="swing") {
if (xSpeed>=540||xSpeed<=50) {
speed*=-1;
}
xSpeed+=speed;
}
Now I should drop the ball on each mouse click, and placed the ball on stack based on some conditions. I used a separate movieclip to have the base of the stack and to add the balls each time on mouse click. From the second ball, each ball will be placed on the stack only if it is hit the previous one in a least best position. The score will be calculated based on the position it placed on the stack.