public BS_DiningTable()
        {
            //Dining Table
            SwinGame.LoadBitmapNamed("diningTable.png", "diningTable.png");
            _diningTable = SwinGame.CreateSprite(SwinGame.BitmapNamed("diningTable.png"));
            //

            //initialize a food sprite without image
            _food = SwinGame.CreateSprite(SwinGame.BitmapNamed(""));

            //get a new customer
            _customer = BS_PokemonCustomerGenerator.NewCustomer();

            //initialize Timer and start it for the first customer, set ticks to 0 and set the state of customer as waiting
            _gameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_gameTime);
            _ticks   = 0;
            _waiting = true;
            //

            //initiate a new red status bar
            _statusBar = new BS_StatusBar("emptyThick.png");
            _statusBar.SetFillingImage("redThick.png");
            //
        }
示例#2
0
文件: Game.cs 项目: DumiM/Orbitals
        public Game()
        {
            //initialise all game variables
            //including statuses, blackhole and planet sizes
            InitialiseVariables();

            //start the timer
            _gameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_gameTime);


            _spaceEntities = new List <SpaceEntity>();

            SwinGame.OpenGraphicsWindow("Orbitals", 1300, 700);
            _panel = new Panel();

            SwinGame.ClearScreen(Color.White);

            _input   = new Input();
            MousePos = null;

            _count = 0;

            _lastTicks = SwinGame.TimerTicks(_gameTime);
        }
        public ZYMediumMode(ViewManager viewManager) : base(viewManager)
        {
            _sideBar     = new EasyModeSideBar(_viewManager);
            _servingArea = new ZYServingAreaMedium();

            _btmBar = new ZYBottomBar();

            _giveUpButton = new ZYButton("pauseButton.png");
            _giveUpButton.SetWidth(80);
            _giveUpButton.SetHeight(80);
            _giveUpButton.SetText("Pause", 20);

            //Register for Observer Pattern
            foreach (ZYDiningTable diningTable in _servingArea.DiningTable)
            {
                diningTable.RegisterSideBar(_sideBar);
            }
            _btmBar.RegisterStove(_servingArea.Stoves);
            _servingArea.Player.RegisterHoldingFrame(_sideBar.HoldingFoodFrame);
            //

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

            //initiate new BlUE status bar
            _statusBar = new ZYStatusBar("blackprogressbar.png");
            _statusBar.SetFillingImage("blueprogressbar.png");
            //
        }
示例#4
0
        /// <summary>
        /// Create a new game of Snap!
        /// </summary>
        public Snap()
        {
            _deck = new Deck();

            _gameTimer = SwinGame.CreateTimer
                             ();
        }
        public MWMarioDiningTable()
        {
            //Dining Table
            SwinGame.LoadBitmapNamed("diningTable.png", "diningTable.png");
            _mariodiningTable = SwinGame.CreateSprite(SwinGame.BitmapNamed("diningTable.png"));
            //

            //initialize a food sprite without image
            _mariofood = SwinGame.CreateSprite(SwinGame.BitmapNamed(""));

            //get a new customer
            _mariocustomer = MWMarioCustomerGenerator.NewMarioCustomer();

            //initialize Timer and start it for the first customer, set ticks to 0 and set the state of customer as waiting
            _mariogameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_mariogameTime);
            _marioticks   = 0;
            _mariowaiting = true;
            //

            //initiate a new red status bar
            _mariostatusBar = new MWStatusBar("emptyThick.png");
            _mariostatusBar.SetFillingImage("redThick.png");
            //
        }
        public ZYSideBar(ViewManager viewManager)
        {
            _holdingFoodFrame = new ZYHoldingFoodFrame();

            _viewManager = viewManager;

            _gameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_gameTime);

            winStar   = 0;
            _life     = 6;
            _gameLife = new ZYGameLife();

            SwinGame.LoadBitmapNamed("side", "side_menu.png");
            _sideBar = SwinGame.CreateSprite(SwinGame.BitmapNamed("side"));

            SwinGame.LoadBitmapNamed("star.png", "star.png");
            SwinGame.LoadBitmapNamed("yellowStar.png", "yellowStar.png");
            star1 = SwinGame.CreateSprite(SwinGame.BitmapNamed("star.png"));
            star2 = SwinGame.CreateSprite(SwinGame.BitmapNamed("star.png"));
            star3 = SwinGame.CreateSprite(SwinGame.BitmapNamed("star.png"));
            star4 = SwinGame.CreateSprite(SwinGame.BitmapNamed("yellowStar.png"));
            star5 = SwinGame.CreateSprite(SwinGame.BitmapNamed("yellowStar.png"));
            star6 = SwinGame.CreateSprite(SwinGame.BitmapNamed("yellowStar.png"));
        }
示例#7
0
        /// <summary>
        /// Create a new game of Snap!
        /// </summary>
        public Snap()
        {
            _deck = new Deck();

            //Creates a timer for the game - needs to be started in constructor
            //_gameTimer = SwinGame.CreateTimer();
            _gameTimer = SwinGame.CreateTimer();
            SwinGame.LoadSoundEffectNamed("Slap", "slap.wav");
        }
示例#8
0
        public CooldownHandler(float ms)
        {
            threshhold = ms;

            stateMachine = new StateMachine <State, Trigger>(State.READY);
            timer        = SwinGame.CreateTimer();

            ConfigureStateMachine();
        }
示例#9
0
 public ZYPlayerWish(string emptyBar)
 {
     SwinGame.LoadBitmapNamed(emptyBar, emptyBar);
     _statusBar = SwinGame.CreateSprite(SwinGame.BitmapNamed(emptyBar));
     timer      = SwinGame.CreateTimer();
     //wish background
     SwinGame.LoadBitmapNamed("blackThought.png", "blackThought.png");
     _wishBackground = SwinGame.CreateSprite(SwinGame.BitmapNamed("blackThought.png"));
     //
 }
示例#10
0
        public ZYMovement()
        {
            _speed = 1;
            _ticks = 60;

            _gameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_gameTime);

            _statusBar = new ZYStatusBar("hb_01c.png");
            _statusBar.SetFillingImage("hb_01b.png");
        }
示例#11
0
        public Component(
            string id, string filePath, Point2D refPos, Point2D offsetPos, Shape shape, List <Color> colors,
            int health, Vector vel, Vector dir, BoundaryStrategy boundaryStrat, Team team, bool optimiseMe = false
            ) : base(id, filePath, refPos, offsetPos, shape, colors, health, vel, dir, boundaryStrat, team, optimiseMe)
        {
            childComponents = new List <Component>();

            hurtThreshhold = 500;
            hurtTimer      = SwinGame.CreateTimer();
            isHurting      = false;
        }
示例#12
0
    /// <summary>
    /// Completes the deployment phase of the game and
    /// switches to the battle mode (Discovering state)
    /// </summary>
    /// <remarks>
    /// This adds the players to the game before switching
    /// state.
    /// </remarks>
    public static void EndDeployment()
    {
        //deploy the players
        _theGame.AddDeployedPlayer(_human);
        _theGame.AddDeployedPlayer(_ai);

        countdown = SwinGame.CreateTimer();
        SwinGame.StartTimer(countdown);


        SwitchState(GameState.Discovering);
    }
示例#13
0
 public Ship(
     string id, string filePath, Point2D refPos, Point2D offsetPos,
     Shape shape, List <Color> colors, int health, Vector vel, Vector dir, int threshhold,
     BoundaryStrategy boundaryStrat, Team team, List <Component> components
     ) : base(id, filePath, refPos, offsetPos, shape, colors, health, vel, dir, boundaryStrat, team)
 {
     componentList  = components;
     Damage         = 1;
     hurtTimer      = SwinGame.CreateTimer();
     isHurting      = false;
     hurtThreshhold = threshhold;
 }
        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);
        }
示例#15
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);
        }
示例#16
0
        public ZYEasyPlayerMovement()
        {
            _speed = 1;
            _ticks = 60;

            _gameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_gameTime);

            _statusBar = new ZYStatusBar("hb_01c.png");
            _statusBar.SetFillingImage("hb_01b.png");

            zYPlayerWish = new ZYPlayerWish("");
            zYPlayerWish.SetFillingImage("normalEmoji.png");
        }
        public EasyModeSideBar(ViewManager viewManager)
        {
            _holdingFoodFrame = new ZYHoldingFoodFrame();

            _viewManager = viewManager;

            _gameTime = SwinGame.CreateTimer();
            SwinGame.StartTimer(_gameTime);

            _life     = 6;
            _gameLife = new ZYGameLife();

            SwinGame.LoadBitmapNamed("side", "side_menu.png");
            _sideBar = SwinGame.CreateSprite(SwinGame.BitmapNamed("side"));
        }
示例#18
0
        public GameModule(Ship p, Level level, AISpawner aiSpawner, EntityHandler entHandler, CollisionHandler collHandler,
                          CameraHandler camHandler, GameSendData gameSendData, Scoresheet scoresheet, InputController inpController
                          )
        {
            player            = p;
            Level             = level;
            entityHandler     = entHandler;
            collisionHandler  = collHandler;
            cameraHandler     = camHandler;
            inputController   = inpController;
            this.scoresheet   = scoresheet;
            this.aiSpawner    = aiSpawner;
            this.gameSendData = gameSendData;

            gameTimer = SwinGame.CreateTimer();
            gameTimer.Start();
        }
        public BS_Stove(BS_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 BS_StatusBar("emptyThick.png");
            _statusBar.SetFillingImage("blueThick.png");
            //
        }
示例#20
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();
     /// Edited for task
 }
示例#21
0
    public static void Main()
    {
        //Opens a new Graphics Window
        SwinGame.OpenGraphicsWindow("Battle Ships", 800, 600);

        //Load Resources
        GameResources.LoadResources();

        SwinGame.PlayMusic(GameResources.GameMusic("Background"));
        Timer a = SwinGame.CreateTimer();

        SwinGame.StartTimer(a);
        //Game Loop
        do
        {
            uint time = SwinGame.TimerTicks(a) / 1000;
            GameController.time = time;
            if (GameController.CurrentState == GameState.Quitting)
            {
                SwinGame.StopTimer(a);
            }
            GameController.HandleUserInput();

            GameController.DrawScreen();


            if (SwinGame.KeyTyped(KeyCode.vk_q))
            {
                var myBit = SwinGame.LoadBitmap("ExitConfirmation.png");
                SwinGame.DrawBitmap("ExitConfirmation.png", 160, 150);
                SwinGame.RefreshScreen();
                SwinGame.Delay(5000);
            }

            if (SwinGame.KeyTyped(KeyCode.vk_y))
            {
                GameController.AddNewState(GameState.Quitting);
            }

            if (SwinGame.KeyTyped(KeyCode.vk_n))
            {
                SwinGame.StopMusic();
            }
            if (SwinGame.KeyTyped(KeyCode.vk_m))
            {
                SwinGame.PlayMusic(GameResources.GameMusic("Background"));
            }
            if (SwinGame.KeyTyped(KeyCode.vk_l))
            {
                SwinGame.PlayMusic(GameResources.GameMusic("Background2"));
            }
            if (SwinGame.KeyTyped(KeyCode.vk_f))
            {
                var myBit = SwinGame.LoadBitmap("bitmap.jpg");
                SwinGame.DrawBitmap("bitmap.jpg", 20, 20);
                SwinGame.RefreshScreen();
                SwinGame.Delay(10000);
            }
        } while (!(SwinGame.WindowCloseRequested() == true | GameController.CurrentState == GameState.Quitting));

        SwinGame.StopMusic();

        //Free Resources and Close Audio, to end the program.
        GameResources.FreeResources();
    }
示例#22
0
文件: Snap.cs 项目: cait11/QuickSnap
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer(); // Create the game timer
 }
示例#23
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();              //creates gametimer object
 }
示例#24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Escapade.Countdown"/> class.
 /// </summary>
 public Countdown()
 {
     timer = SwinGame.CreateTimer();
 }
示例#25
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();
     //creates the timer with the deck
 }
示例#26
0
文件: Snap.cs 项目: Jun0715/QuickSnap
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();              //Add by Chua Chung Long
 }
示例#27
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();              //added new line
 }