Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package code
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.events.TimerEvent;
- import flash.utils.Timer;
- public class FruitClass extends MovieClip
- {
- public var fallingSpeed:Number;
- public static var aNumber:Number;
- public const terminalVelocity:Number = 40;
- public var velocity:Number;
- public static var fruitCount:Number = 0;
- public function FruitClass()
- {
- fruitCount++;
- var mySpeed=1;
- fallingSpeed = mySpeed / 2;
- if (fallingSpeed >=terminalVelocity )
- {
- fallingSpeed = terminalVelocity;
- }
- velocity = mySpeed;
- trace(fallingSpeed);
- if(fruitCount<=60)
- {
- gotoAndStop("apple");
- }
- else if(fruitCount <=100)
- {
- gotoAndStop("cherry");
- }
- else if (fruitCount <= 140)
- {
- gotoAndStop("orange");
- }
- }
- public function removeFruit():void
- {
- removeChild(this);
- }
- public function moveFruit():void
- {
- /*if (velocity > terminalVelocity)
- {
- velocity = terminalVelocity;
- }*/
- y += velocity;
- rotation += velocity/5;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment