示例#1
0
        private void Add(FixedBall ball)
        {
            uint id = FixedBallId;

            FixedDictionary[id] = ball;
            FixedCreateMessage(this, new FixedCreateArgs(id, ball));
        }
示例#2
0
 public void Update()
 {
     while (FixedDictionary.Count < MaxSize)
     {
         FixedBall ball = RandomBall();
         Add(ball);
     }
 }
示例#3
0
        public static FixedBall RandomBall()
        {
            var width  = Program.GameWidth;
            var height = Program.GameHeight;
            var ball   = new FixedBall();

            ball.X      = RandomMaker.Next(width);
            ball.Y      = RandomMaker.Next(height);
            ball.Radius = FixedBall.DefaultPlayerRadius;
            ball.Color  = CustomColors.RandomColor;
            return(ball);
        }
示例#4
0
 public FixedCreateArgs(uint id, FixedBall ball)
 {
     BallId = id;
     Ball   = ball;
 }