Exemplo n.º 1
0
        public void Update(GameTime gameTime, WeaponManager wManager)
        {
            mouseStateCurr = Mouse.GetState();

            if (Keyboard.GetState().IsKeyDown(Keys.D1) && wManager.checkReady())
            {
                if (rainbowIcon != rainbowIconSel)
                {
                    wManager.CurrentWeapon = 0;
                    rainbowIcon = rainbowIconSel;
                    bombIcon = bombIconUnsel;
                    missileIcon = missileIconUnsel;
                }
            }
            else if (Keyboard.GetState().IsKeyDown(Keys.D2) && wManager.checkReady())
            {
                if (bombIcon != bombIconSel)
                {
                    wManager.CurrentWeapon = 1;

                    rainbowIcon = rainbowIconUnsel;
                    bombIcon = bombIconSel;
                    missileIcon = missileIconUnsel;
                }
            }
            else if (Keyboard.GetState().IsKeyDown(Keys.D3) && wManager.checkReady())
            {
                if (missileIcon != missileIconSel)
                {
                    //wManager.CurrentWeapon = 2;

                    rainbowIcon = rainbowIconUnsel;
                    bombIcon = bombIconUnsel;
                    missileIcon = missileIconSel;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;
            graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;

            //            graphics.PreferredBackBufferWidth = 800;
            //            graphics.PreferredBackBufferHeight = 600;

            //graphics.ToggleFullScreen();

            this.Window.Title = "Too Cute To Live";

            graphics.ApplyChanges();

            Class1.graph = graphics;

            mCharacterManager = CharacterManager.GetInstance(Content, graphics);

            mMenu = new Menu(this);
            mScoring = new Scoring();
            mIntro = new Intro();

            mItemManager = new ItemManager(Content);

            mCam = new Camera(graphics.GraphicsDevice.Viewport);

            hud = new HUD();
            wM = new WeaponManager(Content, graphics);

            /* Number of seconds the level will run */
            timer = 60.0f;

            temp = rand.Next(0, 10);

            base.Initialize();
        }