Esempio n. 1
0
 public Game()
 {
     thread = new Thread(Action);
     thread.IsBackground = true;
     level = new Level(1, 10);
     glass = new Glass(10, 20);
     glass.LinesRemoved += glass_LinesRemoved;
     defPosition         = new XY(4, 19);
     gameOver            = false;
 }
Esempio n. 2
0
 public bool PlaceToGlass(Glass glass, XY location)
 {
     if (this.glass != null)
     {
         Hide();
     }
     this.glass    = glass;
     this.location = location;
     if (glass.ThereBrick(GetPosition()))
     {
         return(false);
     }
     Show();
     return(true);
 }
Esempio n. 3
0
        /// <summary>
        /// init all objects
        /// </summary>
        public void Start()
        {
            RootGameObject = GameObject.Find("Root");
            tetris         = RootGameObject.GetComponent <Tetris>();

            glass   = new Glass(Mode);
            checker = new Checker(glass);
            DoInit  = true;

            figures   = new Figures(Mode);
            NewFigure = true;

            userInput = new UserInput();
            DoUpdate  = false;
            GameOver  = false;
        }
Esempio n. 4
0
 /// <summary>
 /// constructor to recieve glass size and content
 /// </summary>
 /// <param name="glass"></param>
 public Checker(Glass glass)
 {
     this.Width  = glass.Width;
     this.Height = glass.Height;
     this.Board  = glass.Board;
 }