public ZYServingArea()
        {
            _gameTime  = SwinGame.CreateTimer();
            _soundTime = SwinGame.CreateTimer();
            // Random the first energy potion
            _energyPotion = new ZYEnergyBall();
            _energyPotion.SetX(_random.Next(10, 340));
            _energyPotion.SetY(_random.Next(115, 190));
            //

            SwinGame.StartTimer(_soundTime);
            // STOVE
            //2 table of stove
            _tableOfStoves     = new ZYTableOfStove [2];
            _tableOfStoves [0] = new ZYTableOfStove();
            _tableOfStoves [1] = new ZYTableOfStove();
            //
            //2 stove and bind corresponding table to it
            _stove     = new ZYStove [2];
            _stove [0] = new ZYStove(_tableOfStoves [0]);
            _stove [1] = new ZYStove(_tableOfStoves [1]);

            _stoveManager = new ZYStoveManager(_stove);
            //

            // 4 Dining Tables
            _diningTables = new ZYWoodenTable [4];
            for (int i = 0; i < 4; i++)
            {
                _diningTables [i] = new ZYWoodenTable();
            }
            _diningTableManager = new ZYDiningTableManager(_diningTables);
            //

            //
            SwinGame.LoadBitmapNamed("floor", "white_floor.jpg");
            _floor = SwinGame.CreateSprite(SwinGame.BitmapNamed("floor"));
            //

            //
            SwinGame.LoadBitmapNamed("sky", "sky_background.jpg");
            _sky = SwinGame.CreateSprite(SwinGame.BitmapNamed("sky"));
            //

            //
            SwinGame.LoadBitmapNamed("sink", "Dustbin.png");
            _dustbin = SwinGame.CreateSprite(SwinGame.BitmapNamed("sink"));
            //

            _player = new ZYEasyPlayer();
            _player.SetX(140);
            _player.SetY(120);
        }
コード例 #2
0
        public ZYStove(ZYTableOfStove tableOfStove)
        {
            //set the food to cook to null and cooking state as false
            _foodToCook = "";
            _cooking    = false;
            //

            //bind the table
            _tableOfStove = tableOfStove;

            //create the stove SPRITE
            SwinGame.LoadBitmapNamed("stove", "stove.png");
            _stove = SwinGame.CreateSprite(SwinGame.BitmapNamed("stove"));
            //

            //initiate _gameTime
            _gameTime = SwinGame.CreateTimer();

            //initiate new BlUE status bar
            _statusBar = new ZYStatusBar("emptyThick.png");
            _statusBar.SetFillingImage("blueThick.png");
            //
        }