示例#1
0
        public MWMarioServingArea()
        {
            _mariogameTime = SwinGame.CreateTimer();

            // Random the first energy potion
            _marioenergyPotion = new MWEnergyBall();
            _marioenergyPotion.SetX(_mariorandom.Next(10, 340));
            _marioenergyPotion.SetY(_mariorandom.Next(115, 190));
            //

            // STOVE
            //2 table of stove
            _mariotableOfStoves    = new TableOfStove[2];
            _mariotableOfStoves[0] = new TableOfStove();
            _mariotableOfStoves[1] = new TableOfStove();
            //
            //2 stove and bind corresponding table to it
            _mariostove    = new Stove[2];
            _mariostove[0] = new Stove(_mariotableOfStoves[0]);
            _mariostove[1] = new Stove(_mariotableOfStoves[1]);

            _mariostoveManager = new StoveManager(_mariostove);
            //

            // 4 Dining Tables
            _mariodiningTables = new MWMarioWoodenTable[4];
            for (int i = 0; i < 4; i++)
            {
                _mariodiningTables[i] = new MWMarioWoodenTable();
            }
            _mariodiningTableManager = new MWMarioDiningTableManager(_mariodiningTables);
            //

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

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

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

            _marioplayer = new MWPlayer();
            _marioplayer.SetX(140);
            _marioplayer.SetY(120);
        }
        public Stove(TableOfStove 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 MWStatusBar("emptyThick.png");
            _statusBar.SetFillingImage("blueThick.png");
            //
        }