Exemple #1
0
        public Ball(Color color, PointF point, float jumpSpeed, float radius, Frame frame, Direction direction)
        {
            this.pen = new Pen(color);
            this.frame = frame;
            this.x = point.X;
            this.y = point.Y;
            this.jumpSpeed = jumpSpeed;
            this.radius = radius;

            switch (direction)
            {
                case Direction.DOWN:
                    xmt = MoveType.Down;
                    ymt = MoveType.Down;
                    break;
                case Direction.LEFT:
                    xmt = MoveType.Up;
                    ymt = MoveType.Down;
                    break;
                case Direction.RIGHT:
                    xmt = MoveType.Down;
                    ymt = MoveType.Up;
                    break;
                case Direction.UP:
                    xmt = MoveType.Up;
                    ymt = MoveType.Up;
                    break;
            }
        }
 public BallTimerForm()
 {
     this.rand = new Random();
     this.frame = new Frame(this.rand);
     this.ballFactory = new BallFactory(this.rand, this.frame);
     this.InitializeComponent();
     this.initPicture();
 }
Exemple #3
0
 public BallFactory(Random rand, Frame frame)
 {
     this.rand = rand;
     this.frame = frame;
 }