예제 #1
0
 /// <summary>
 /// 加载
 /// </summary>
 public override void init()
 {
     gameStage = game.ctrl.gameStage;
 }
예제 #2
0
        /// <summary>
        /// 初始化对象
        /// </summary>
        public void InitObjects()
        {
            Rectangle clientBounds = tetris.Window.ClientBounds;

            BigStage.AlphaChange = AlphaChange;
            bigStage = new BigStage(tetris);

            /* 在整个场景的中间绘制游戏场景 */
            DropBox.size = boxSize;
            gameStage = new GameStage(new Rectangle((clientBounds.Width - gameStageWidth) / 2,
                (clientBounds.Height - gameStageHeight) / 2, gameStageWidth, gameStageHeight), tetris);

            pointStage = new PointStage(tetris);

            dropBox = new DropBox(tetris);

            input = new InputState();

            table = new Hashtable();

            DropBoxThread = new Thread(new ThreadStart(dropBox.AutoDrop));

            lib = new ResourcesLIB(tetris.Content);
        }
예제 #3
0
 /// <summary>
 /// 加载
 /// </summary>
 public override void init()
 {
     gameStage = game.ctrl.gameStage;
     /* 随机一个形状 */
     string[] strArr = new string[] { S_BOX, Z_BOX, L_BOX, J_BOX, I_BOX, O_BOX, T_BOX };
     Random rd = new Random();
     DropNewBox(strArr[rd.Next(strArr.Length)]);
 }