コード例 #1
0
        public MenuButton(ButtonType bt, SpriteObject backgroundReq)
        {
            background = backgroundReq;

            switch (bt)
            {
                case ButtonType.play:
                    background.spriteTexture = playIcon;
                    break;
                case ButtonType.about:
                    background.spriteTexture = aboutIcon;
                    break;
                case ButtonType.highscores:
                    background.spriteTexture = highscoreIcon;
                    break;
                case ButtonType.setting:
                    background.spriteTexture = settingIcon;
                    break;
            }
        }
コード例 #2
0
        public static void Initialize()
        {
            //Create Background Sprite
            background = new SpriteObject(0, 0, 480, 800);

            //Create Logo Sprite
            logo = new SpriteObject[7];
            end = false;
            for (int i = 0; i < logo.Length; i++)
            {
                logo[i] = new SpriteObject(0, 0, 480, 800);
            }

            //Gas
            backgroundGas = new SpriteObject[4];
            backgroundGas[0] = new SpriteObject(0, 420, 854, 322);
            backgroundGas[1] = new SpriteObject(481, 120, 866, 566);
            backgroundGas[2] = new SpriteObject(481, 200, 822, 484);
            backgroundGas[3] = new SpriteObject(481, 320, 930, 292);

            //Highscore Tiles
            highscore1 = new SpriteObject(25, 350, 200, 200);
            highscore2 = new SpriteObject(245, 350, 200, 200);
            highscore3 = new SpriteObject(25, 575, 200, 200);
            highscore4 = new SpriteObject(245, 575, 200, 200);

            //Set Up

            IsolatedStorageSystem.Initalize();

            if (!IsolatedStorageSystem.CheckFileExist("highscores.xml"))
            {
                HighscoreManager.setUpHighscores();
            }

            //Settings

            if (!IsolatedStorageSystem.CheckFileExist("settings.xml"))
            {
                SettingManager.setUpSettings();
            }

            //Sliders
            soundEffectsSlider = new OnOffSlider(new SpriteObject(300, 320, 165, 61), SettingManager.getSetting(Setting.SoundEffects));
            granddadDeathSoundsSlider = new OnOffSlider(new SpriteObject(300, 400, 165, 61), SettingManager.getSetting(Setting.GranddadDeathSounds));
            vibrationSlider = new OnOffSlider(new SpriteObject(300, 480, 165, 61), SettingManager.getSetting(Setting.Vibration));
            confettiSlider = new OnOffSlider(new SpriteObject(300, 560, 165, 61), SettingManager.getSetting(Setting.Confetti));

            //Intro
            introExplination = new SpriteObject(0, 801, 480, 800);
        }
コード例 #3
0
        private static void animateGasRightToLeft(SpriteObject[] gas, ref int currentGas, int speed)
        {
            gas[currentGas].spriteRectangle.X = gas[currentGas].spriteRectangle.X - speed;

            if (-gas[currentGas].spriteRectangle.X > gas[currentGas].spriteRectangle.Width)
            {
                //Gas is completely off the screen
                //Put it back it its place just off the screen
                gas[currentGas].spriteRectangle.X = 485;
                //Grab the next gas
                currentGas++;

                if (currentGas > (gas.Length - 1))
                {
                    //If we've used all the gases, go back to the first one
                    currentGas = 0;
                }
            }
        }
コード例 #4
0
        public static void Initialize()
        {
            //Logo and background
            gameOverLogoAndBackground = new SpriteObject(0, 0, 480, 800);

            //Highscore Tiles
            highscore1 = new SpriteObject(25, 350, 200, 200);
            highscore2 = new SpriteObject(245, 350, 200, 200);
            highscore3 = new SpriteObject(25, 575, 200, 200);
            highscore4 = new SpriteObject(245, 575, 200, 200);

            noHighscore = new SpriteObject(140, 390, 200, 200);

            //Highscore set
            highscoreSet = false;
        }