Esempio n. 1
0
        private void GenerateObject()
        {
            if (dequeCount == 0)
            {
                ++Kernel.totalCount;

                int EId;
                EId = rand.Next(0, 20) % 6;
                //objId.Enqueue(EId);

                #region GenerateBall
                if (EId != 5)
                {
                    FlyingBall theBall = new FlyingBall();
                    theBall.eId = EId;
                    
                    balls[EId].eId = EId;
                    balls[EId].image.Source = ballImage;
                    theBall.state = BallState.EQUE;

                    enqueBalls.Enqueue(theBall);

                    DequeueBalls();                
                }
                #endregion
                #region GenerateBottles
                else
                {
                    for (int i = 0; i < 3; i++)
                    {
                        bottles[i].bId = rand.Next(0, 5);
                        bottles[i].state = BallState.DQUE;
                        bottles[i].image.Source = bottleImage;
                        bottles[i].MoveBottle();
                    }
                    return;
                }
                #endregion
            }
            dequeCount--;
        }
Esempio n. 2
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 8 "..\..\GameWindow.xaml"
     ((StartConnector.GameWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     
     #line 9 "..\..\GameWindow.xaml"
     ((StartConnector.GameWindow)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.controlPlayer);
     
     #line default
     #line hidden
     
     #line 9 "..\..\GameWindow.xaml"
     ((StartConnector.GameWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);
     
     #line default
     #line hidden
     return;
     case 2:
     this.BackgroundImg = ((System.Windows.Media.ImageBrush)(target));
     return;
     case 3:
     this.GameWindowCanvas = ((System.Windows.Controls.Canvas)(target));
     return;
     case 4:
     this.ResultPanel = ((StartConnector.ResultMenu)(target));
     return;
     case 5:
     this.Maya = ((StartConnector.Player)(target));
     return;
     case 6:
     this.bottle1 = ((StartConnector.FlyingBottle)(target));
     return;
     case 7:
     this.bottle2 = ((StartConnector.FlyingBottle)(target));
     return;
     case 8:
     this.bottle3 = ((StartConnector.FlyingBottle)(target));
     return;
     case 9:
     this.GetPoint = ((StartConnector.ShakingBall)(target));
     return;
     case 10:
     this.CountDown = ((StartConnector.CountingDown)(target));
     return;
     case 11:
     this.ScoreText = ((System.Windows.Controls.Label)(target));
     return;
     case 12:
     this.LeftBall = ((StartConnector.FlyingBall)(target));
     return;
     case 13:
     this.ObliqueLeftBall = ((StartConnector.FlyingBall)(target));
     return;
     case 14:
     this.MiddleBall = ((StartConnector.FlyingBall)(target));
     return;
     case 15:
     this.ObliqueRightBall = ((StartConnector.FlyingBall)(target));
     return;
     case 16:
     this.RightBall = ((StartConnector.FlyingBall)(target));
     return;
     }
     this._contentLoaded = true;
 }