Exemplo n.º 1
0
        public UIElement_ScoreTextBox(Display pDisplay, GameWorld pGameWorld, int pPosX, int pPosY)
            : base(pDisplay, pGameWorld, "", pPosX, pPosY, 0, 0, 0, 0, 0, 0, 0, 0)
        {
            mAcceptPressed = false;
            mCancelPressed = false;
            mFont = pDisplay.aaGame.mTextboxFont;
            mColor = Color.White;
            mTextBox = new UIElement_StaticMenuElement(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mTextBoxXOffset, pPosY + mTextBoxYOffset, 0, 0, Constants.LAYER_UI_FRONT, 0, 197, 301, 39, 0);
            mNameLabel = new UIElement_StaticMenuElement(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mNameLabelXOffset, pPosY + mNameLabelYOffset, 0, 0, Constants.LAYER_UI_FRONT, 302, 197, 150, 39, 0);
            mAcceptButton = new UIElement_MenuButton(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mAcceptButtonXOffset, pPosY + mAcceptButtonYOffset, 0, 0, Constants.LAYER_UI_FRONT, 0, 157, 100, 39, 0);
            mCancelButton = new UIElement_MenuButton(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mCancelButtonXOffset, pPosY + mCancelButtonYOffset, 0, 0, Constants.LAYER_UI_FRONT, 201, 157, 100, 39, 0);

            // Initialize the key dictionary
            characterByKey = new Dictionary<Keys, char>()
            {
                {Keys.A, 'a'},
                {Keys.B, 'b'},
                {Keys.C, 'c'},
                {Keys.D, 'd'},
                {Keys.E, 'e'},
                {Keys.F, 'f'},
                {Keys.G, 'g'},
                {Keys.H, 'h'},
                {Keys.I, 'i'},
                {Keys.J, 'j'},
                {Keys.K, 'k'},
                {Keys.L, 'l'},
                {Keys.M, 'm'},
                {Keys.N, 'n'},
                {Keys.O, 'o'},
                {Keys.P, 'p'},
                {Keys.Q, 'q'},
                {Keys.R, 'r'},
                {Keys.S, 's'},
                {Keys.T, 't'},
                {Keys.U, 'u'},
                {Keys.V, 'v'},
                {Keys.W, 'w'},
                {Keys.X, 'x'},
                {Keys.Y, 'y'},
                {Keys.Z, 'z'},
                {Keys.D0, '0'},
                {Keys.D1, '1'},
                {Keys.D2, '2'},
                {Keys.D3, '3'},
                {Keys.D4, '4'},
                {Keys.D5, '5'},
                {Keys.D6, '6'},
                {Keys.D7, '7'},
                {Keys.D8, '8'},
                {Keys.D9, '9'},
                {Keys.NumPad0, '0'},
                {Keys.NumPad1, '1'},
                {Keys.NumPad2, '2'},
                {Keys.NumPad3, '3'},
                {Keys.NumPad4, '4'},
                {Keys.NumPad5, '5'},
                {Keys.NumPad6, '6'},
                {Keys.NumPad7, '7'},
                {Keys.NumPad8, '8'},
                {Keys.NumPad9, '9'},
                {Keys.OemPeriod, '.'},
                {Keys.OemMinus, '-'},
                {Keys.Space, ' '}
            };
            mTextBoxText = new StringBuilder();
            mPreviousKeyState = Keyboard.GetState();
        }
Exemplo n.º 2
0
        public override void EnterState()
        {
            base.EnterState();

            Abilitydata = mGameReference.aaDisplay.aaGame.aaHSManager.Abilitydata;

            lockedKit = new AssetKit_Ability_Locked();
            quickturnKit = new AssetKit_Ability_QuickTurn();
            warpdriveKit = new AssetKit_Ability_WarpDrive();
            gunoverchargeKit = new AssetKit_Ability_GunOvercharge();
            bulletstarKit = new AssetKit_Ability_BulletStar();
            bulletfurryKit = new AssetKit_Ability_BulletFurry();
            dualwieldKit = new AssetKit_Ability_DualWield();
            missileflurryKit = new AssetKit_Ability_MissileFlurry();
            overchargeenginesKit = new AssetKit_Ability_OverchargeEngines();
            tighterturnsKit = new AssetKit_Ability_TighterTurns();
            energyshieldKit = new AssetKit_Ability_EnergyShield();
            shotgunblastKit = new AssetKit_Ability_ShotgunBlast();
            reargunsKit = new AssetKit_Ability_RearGuns();
            antibulletsKit = new AssetKit_Ability_AntiBullets();
            satelliteKit = new AssetKit_Ability_Satellite();
            mineKit = new AssetKit_Ability_Mine();
            fullshieldKit = new AssetKit_Ability_FullShield();
            DefaultAbility1 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, quickturnKit.ASSET_NAME, 633, 335, (int)quickturnKit.ORIGIN.X, (int)quickturnKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, quickturnKit.SRC_RECTX, quickturnKit.SRC_RECTY, quickturnKit.SRC_RECTWIDTH, quickturnKit.SRC_RECTHEIGHT, 0.0f);
            DefaultAbility2 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, warpdriveKit.ASSET_NAME, 705, 335, (int)warpdriveKit.ORIGIN.X, (int)warpdriveKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, warpdriveKit.SRC_RECTX, warpdriveKit.SRC_RECTY, warpdriveKit.SRC_RECTWIDTH, warpdriveKit.SRC_RECTHEIGHT, 0.0f);
            DefaultAbility3 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, gunoverchargeKit.ASSET_NAME, 779, 335, (int)gunoverchargeKit.ORIGIN.X, (int)gunoverchargeKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, gunoverchargeKit.SRC_RECTX, gunoverchargeKit.SRC_RECTY, gunoverchargeKit.SRC_RECTWIDTH, gunoverchargeKit.SRC_RECTHEIGHT, 0.0f);
            DefaultAbility4 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, bulletstarKit.ASSET_NAME, 849, 335, (int)bulletstarKit.ORIGIN.X, (int)bulletstarKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, bulletstarKit.SRC_RECTX, bulletstarKit.SRC_RECTY, bulletstarKit.SRC_RECTWIDTH, bulletstarKit.SRC_RECTHEIGHT, 0.0f);
            SpecialAbility1 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 633, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f);
            SpecialAbility2 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 705, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f);
            SpecialAbility3 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 779, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f);
            SpecialAbility4 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, lockedKit.ASSET_NAME, 849, 482, (int)lockedKit.ORIGIN.X, (int)lockedKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, lockedKit.SRC_RECTX, lockedKit.SRC_RECTY, lockedKit.SRC_RECTWIDTH, lockedKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility1);
            mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility2);
            mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility3);
            mGameReference.aaDisplay.AddMenuUIElement(DefaultAbility4);
            mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility1);
            mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility2);
            mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility3);
            mGameReference.aaDisplay.AddMenuUIElement(SpecialAbility4);

            abilitykit = new AssetKit_AbilityButton();
            ability1Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 639, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            ability2Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 711, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            ability3Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 785, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            ability4Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 855, 206, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            default1Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 639, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            default2Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 711, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            default3Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 785, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            default4Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 855, 341, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            special1Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 639, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            special2Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 711, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            special3Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 785, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            special4Button = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitykit.ASSET_NAME, 855, 488, (int)abilitykit.ORIGIN.X, (int)abilitykit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.2f, abilitykit.SRC_RECTX, abilitykit.SRC_RECTY, abilitykit.SRC_RECTWIDTH, abilitykit.SRC_RECTHEIGHT, 0.0f);
            ability1Button.highlightDisabled = true;
            ability2Button.highlightDisabled = true;
            ability3Button.highlightDisabled = true;
            ability4Button.highlightDisabled = true;
            mGameReference.aaDisplay.AddMenuUIElement(ability1Button);
            mGameReference.aaDisplay.AddMenuUIElement(ability2Button);
            mGameReference.aaDisplay.AddMenuUIElement(ability3Button);
            mGameReference.aaDisplay.AddMenuUIElement(ability4Button);
            mGameReference.aaDisplay.AddMenuUIElement(default1Button);
            mGameReference.aaDisplay.AddMenuUIElement(default2Button);
            mGameReference.aaDisplay.AddMenuUIElement(default3Button);
            mGameReference.aaDisplay.AddMenuUIElement(default4Button);
            mGameReference.aaDisplay.AddMenuUIElement(special1Button);
            mGameReference.aaDisplay.AddMenuUIElement(special2Button);
            mGameReference.aaDisplay.AddMenuUIElement(special3Button);
            mGameReference.aaDisplay.AddMenuUIElement(special4Button);

            backButtonKit = new AssetKit_Menu_BackButton();
            backButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, backButtonKit.ASSET_NAME, 1060, 370, (int)backButtonKit.ORIGIN.X, (int)backButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, backButtonKit.SRC_RECTX, backButtonKit.SRC_RECTY, backButtonKit.SRC_RECTWIDTH, backButtonKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(backButton);

            rightButtonKit = new AssetKit_RightArrowButton();
            rightButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, rightButtonKit.ASSET_NAME, 325, 90, (int)rightButtonKit.ORIGIN.X, (int)rightButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, rightButtonKit.SRC_RECTX, rightButtonKit.SRC_RECTY, rightButtonKit.SRC_RECTWIDTH, rightButtonKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(rightButton);

            leftButtonKit = new AssetKit_LeftArrowButton();
            leftButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, leftButtonKit.ASSET_NAME, 180, 90, (int)leftButtonKit.ORIGIN.X, (int)leftButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, leftButtonKit.SRC_RECTX, leftButtonKit.SRC_RECTY, leftButtonKit.SRC_RECTWIDTH, leftButtonKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(leftButton);

            playButtonKit = new AssetKit_PlayButton();
            playButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, playButtonKit.ASSET_NAME, 1060, 270, (int)playButtonKit.ORIGIN.X, (int)playButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, playButtonKit.SRC_RECTX, playButtonKit.SRC_RECTY, playButtonKit.SRC_RECTWIDTH, playButtonKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(playButton);

            aiconKit = new AssetKit_AgilityIcon();
            ticonKit = new AssetKit_TankIcon();
            ciconKit = new AssetKit_CommandoIcon();
            ShipIcon = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, aiconKit.ASSET_NAME, 235, 85, (int)aiconKit.ORIGIN.X, (int)aiconKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, aiconKit.SRC_RECTX, aiconKit.SRC_RECTY, aiconKit.SRC_RECTWIDTH, aiconKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(ShipIcon);

            shipselectKit = new AssetKit_ShipSelect();
            ShipSelect = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, shipselectKit.ASSET_NAME, 20, 10, (int)shipselectKit.ORIGIN.X, (int)shipselectKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, shipselectKit.SRC_RECTX, shipselectKit.SRC_RECTY, shipselectKit.SRC_RECTWIDTH, shipselectKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(ShipSelect);

            helpKit = new AssetKit_ShipMenu_Help();
            HelpPlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, helpKit.ASSET_NAME, 20, 365, (int)helpKit.ORIGIN.X, (int)helpKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, helpKit.SRC_RECTX, helpKit.SRC_RECTY, helpKit.SRC_RECTWIDTH, helpKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(HelpPlaque);

            abilityselectKit = new AssetKit_AbilitySelect();
            AbilitySelect = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilityselectKit.ASSET_NAME, 535, 60, (int)abilityselectKit.ORIGIN.X, (int)abilityselectKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, abilityselectKit.SRC_RECTX, abilityselectKit.SRC_RECTY, abilityselectKit.SRC_RECTWIDTH, abilityselectKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(AbilitySelect);

            mAbilityBox = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mTextboxFont, 900 - (int)(textSize.X / 2), 560, Color.White, "");
            mDescriptionBox = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescriptionFont, 935 - (int)(textSize.X / 2), 600, Color.White, "");
            mGameReference.aaDisplay.AddMenuUIElement(mAbilityBox);
            mGameReference.aaDisplay.AddMenuUIElement(mDescriptionBox);

            mShipName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mTextboxFont, 270 - (int)(textSize.X / 2), 185, Color.White, shipname);
            mHealth = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescription2Font, 131, 230, Color.White, "Health: " + health);
            mMaxThrust = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescription2Font, 132, 260, Color.White, "Max Thrust: " + maxthrust);
            mTurnSpeed = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.mDescription2Font, 130, 290, Color.White, "Turn Speed: " + turnspeed);

            slot1Kit = new AssetKit_Ability_Slot1();
            slot2Kit = new AssetKit_Ability_Slot2();
            slot3Kit = new AssetKit_Ability_Slot3();
            slot4Kit = new AssetKit_Ability_Slot4();
            Ability1 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 633, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f);
            Ability2 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 705, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f);
            Ability3 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 779, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f);
            Ability4 = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, slot1Kit.ASSET_NAME, 849, 200, (int)slot1Kit.ORIGIN.X, (int)slot1Kit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH - 0.1f, slot1Kit.SRC_RECTX, slot1Kit.SRC_RECTY, slot1Kit.SRC_RECTWIDTH, slot1Kit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(Ability1);
            mGameReference.aaDisplay.AddMenuUIElement(Ability2);
            mGameReference.aaDisplay.AddMenuUIElement(Ability3);
            mGameReference.aaDisplay.AddMenuUIElement(Ability4);

            ShipChangeUpdate();
        }
Exemplo n.º 3
0
        public override void LeaveState()
        {
            base.LeaveState();

            shipselectKit = null;
            aiconKit = null;
            ticonKit = null;
            ciconKit = null;
            ShipSelect.MenuDestroy();
            ShipSelect = null;

            leftButtonKit = null;
            leftButton.MenuDestroy();
            leftButton = null;

            rightButtonKit = null;
            rightButton.MenuDestroy();
            rightButton = null;

            backButtonKit = null;
            backButton.MenuDestroy();
            backButton = null;

            mAbilityBox.MenuDestroy();
            mAbilityBox = null;

            mGameReference.aaDisplay.mMenuUIElements.Clear();
        }
Exemplo n.º 4
0
        public override void EnterState()
        {
            base.EnterState();

            //Music plug
            mGameReference.mMusicGameplay_Instance.Stop();
            mGameReference.mMusicMenu_Instance.Play();

            titleKit = new AssetKit_Menu_Title();
            gameTitle = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, titleKit.ASSET_NAME, 640, 180, (int)titleKit.ORIGIN.X, (int)titleKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, titleKit.SRC_RECTX, titleKit.SRC_RECTY, titleKit.SRC_RECTWIDTH, titleKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(gameTitle);

            startKit = new AssetKit_Menu_Button_StartGame();
            startButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, startKit.ASSET_NAME, 540, 260, (int)startKit.ORIGIN.X, (int)startKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, startKit.SRC_RECTX, startKit.SRC_RECTY, startKit.SRC_RECTWIDTH, startKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(startButton);

            instructionKit = new AssetKit_Menu_Button_Instructions();
            instructionButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, instructionKit.ASSET_NAME, 540, 350, (int)instructionKit.ORIGIN.X, (int)instructionKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, instructionKit.SRC_RECTX, instructionKit.SRC_RECTY, instructionKit.SRC_RECTWIDTH, instructionKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(instructionButton);

            scoresKit = new AssetKit_Menu_Button_Scores();
            scoresButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, scoresKit.ASSET_NAME, 540, 440, (int)scoresKit.ORIGIN.X, (int)scoresKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, scoresKit.SRC_RECTX, scoresKit.SRC_RECTY, scoresKit.SRC_RECTWIDTH, scoresKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(scoresButton);

            quitKit = new AssetKit_Menu_Button_Quit();
            quitButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, quitKit.ASSET_NAME, 540, 530, (int)quitKit.ORIGIN.X, (int)quitKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, quitKit.SRC_RECTX, quitKit.SRC_RECTY, quitKit.SRC_RECTWIDTH, quitKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(quitButton);
        }
Exemplo n.º 5
0
        public override void LeaveState()
        {
            base.LeaveState();

            titleKit = null;
            gameTitle.MenuDestroy();
            gameTitle = null;

            startKit = null;
            startButton.MenuDestroy();
            startButton = null;

            instructionKit = null;
            instructionButton.MenuDestroy();
            instructionButton = null;

            scoresKit = null;
            scoresButton.MenuDestroy();
            scoresKit = null;

            quitKit = null;
            quitButton.MenuDestroy();
            quitButton = null;
        }
Exemplo n.º 6
0
        public override void LeaveState()
        {
            base.LeaveState();

            abilitiesKit = null;
            abilitiesPlaque.MenuDestroy();
            abilitiesPlaque = null;

            movementKit = null;
            movementPlaque.MenuDestroy();
            movementPlaque = null;

            creditsKit = null;
            creditsPlaque.MenuDestroy();
            creditsPlaque = null;

            backButtonKit = null;
            backButton.MenuDestroy();
            backButton = null;
        }
Exemplo n.º 7
0
        public override void EnterState()
        {
            base.EnterState();

            abilitiesKit = new AssetKit_Rules_Abilities();
            abilitiesPlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, abilitiesKit.ASSET_NAME, 450, 311, (int)abilitiesKit.ORIGIN.X, (int)abilitiesKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, abilitiesKit.SRC_RECTX, abilitiesKit.SRC_RECTY, abilitiesKit.SRC_RECTWIDTH, abilitiesKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(abilitiesPlaque);

            movementKit = new AssetKit_Rules_Movement();
            movementPlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, movementKit.ASSET_NAME, 450, 50, (int)movementKit.ORIGIN.X, (int)movementKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, movementKit.SRC_RECTX, movementKit.SRC_RECTY, movementKit.SRC_RECTWIDTH, movementKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(movementPlaque);

            pickupsKit = new AssetKit_Rules_PickUps();
            pickupsPlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, pickupsKit.ASSET_NAME, 850, 50, (int)pickupsKit.ORIGIN.X, (int)pickupsKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, pickupsKit.SRC_RECTX, pickupsKit.SRC_RECTY, pickupsKit.SRC_RECTWIDTH, pickupsKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(pickupsPlaque);

            creditsKit = new AssetKit_CreditsPlaque();
            creditsPlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, creditsKit.ASSET_NAME, 50, 50, (int)creditsKit.ORIGIN.X, (int)creditsKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, creditsKit.SRC_RECTX, creditsKit.SRC_RECTY, creditsKit.SRC_RECTWIDTH, creditsKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(creditsPlaque);

            backButtonKit = new AssetKit_Menu_BackButton();
            backButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, backButtonKit.ASSET_NAME, 15, 625, (int)backButtonKit.ORIGIN.X, (int)backButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, backButtonKit.SRC_RECTX, backButtonKit.SRC_RECTY, backButtonKit.SRC_RECTWIDTH, backButtonKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(backButton);
        }
Exemplo n.º 8
0
        public override void LeaveState()
        {
            highscoreKit = null;
            highscorePlaque.MenuDestroy();
            highscorePlaque = null;

            oneName.MenuDestroy();
            twoName.MenuDestroy();
            threeName.MenuDestroy();
            fourName.MenuDestroy();
            fiveName.MenuDestroy();

            if (oneScore != null)
            {
                oneWave.MenuDestroy();
                oneScore.MenuDestroy();
            }
            if (twoScore != null)
            {
                twoScore.MenuDestroy();
                twoWave.MenuDestroy();
            }
            if (threeScore != null)
            {
                threeScore.MenuDestroy();
                threeWave.MenuDestroy();
            }
            if (fourScore != null)
            {
                fourScore.MenuDestroy();
                fourWave.MenuDestroy();
            }
            if (fiveScore != null)
            {
                fiveScore.MenuDestroy();
                fiveWave.MenuDestroy();
            }

            backButtonKit = null;
            backButton.MenuDestroy();
            backButton = null;

            base.LeaveState();

            // TODO: Remove the high score stuff from the screen
        }
Exemplo n.º 9
0
        public override void EnterState()
        {
            base.EnterState();

            data = mGameReference.aaDisplay.aaGame.aaHSManager.Scoredata;

            highscoreKit = new AssetKit_HighScore_Plaque();
            highscorePlaque = new UIElement_StaticMenuElement(mGameReference.aaDisplay, mGameReference.aaGameWorld, highscoreKit.ASSET_NAME, 640, 360, (int)highscoreKit.ORIGIN.X, (int)highscoreKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, highscoreKit.SRC_RECTX, highscoreKit.SRC_RECTY, highscoreKit.SRC_RECTWIDTH, highscoreKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(highscorePlaque);

            oneName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 415, 290, Color.White, data.mName[0] + "");
            mGameReference.aaDisplay.AddMenuUIElement(oneName);
            twoName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 415, 330, Color.White, data.mName[1] + "");
            mGameReference.aaDisplay.AddMenuUIElement(twoName);
            threeName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 415, 370, Color.White, data.mName[2] + "");
            mGameReference.aaDisplay.AddMenuUIElement(threeName);
            fourName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 415, 410, Color.White, data.mName[3] + "");
            mGameReference.aaDisplay.AddMenuUIElement(fourName);
            fiveName = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 415, 450, Color.White, data.mName[4] + "");
            mGameReference.aaDisplay.AddMenuUIElement(fiveName);

            if(data.mScore[0] != 0 && data.mWave[0] != 0)
            {
                oneScore = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 620, 290, Color.White, data.mScore[0] + "");
                mGameReference.aaDisplay.AddMenuUIElement(oneScore);
                oneWave = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 810, 290, Color.White, data.mWave[0] + "");
                mGameReference.aaDisplay.AddMenuUIElement(oneWave);
            }
            if (data.mScore[1] != 0 && data.mWave[1] != 0)
            {
                twoScore = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 620, 330, Color.White, data.mScore[1] + "");
                mGameReference.aaDisplay.AddMenuUIElement(twoScore);
                twoWave = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 810, 330, Color.White, data.mWave[1] + "");
                mGameReference.aaDisplay.AddMenuUIElement(twoWave);
            }
            if (data.mScore[2] != 0 && data.mWave[2] != 0)
            {
                threeScore = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 620, 370, Color.White, data.mScore[2] + "");
                mGameReference.aaDisplay.AddMenuUIElement(threeScore);
                threeWave = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 810, 370, Color.White, data.mWave[2] + "");
                mGameReference.aaDisplay.AddMenuUIElement(threeWave);
            }
            if (data.mScore[3] != 0 && data.mWave[3] != 0)
            {
                fourScore = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 620, 410, Color.White, data.mScore[3] + "");
                mGameReference.aaDisplay.AddMenuUIElement(fourScore);
                fourWave = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 810, 410, Color.White, data.mWave[3] + "");
                mGameReference.aaDisplay.AddMenuUIElement(fourWave);
            }
            if (data.mScore[4] != 0 && data.mWave[4] != 0)
            {
                fiveScore = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 620, 450, Color.White, data.mScore[4] + "");
                mGameReference.aaDisplay.AddMenuUIElement(fiveScore);
                fiveWave = new UIElement_Text(mGameReference.aaDisplay, mGameReference.aaGameWorld, mGameReference.aaDisplay.aaGame.mScoreFont, 810, 450, Color.White, data.mWave[4] + "");
                mGameReference.aaDisplay.AddMenuUIElement(fiveWave);
            }

            backButtonKit = new AssetKit_Menu_BackButton();
            backButton = new UIElement_MenuButton(mGameReference.aaDisplay, mGameReference.aaGameWorld, backButtonKit.ASSET_NAME, 15, 625, (int)backButtonKit.ORIGIN.X, (int)backButtonKit.ORIGIN.Y, Constants.LAYER_ENTITY_DEPTH, backButtonKit.SRC_RECTX, backButtonKit.SRC_RECTY, backButtonKit.SRC_RECTWIDTH, backButtonKit.SRC_RECTHEIGHT, 0.0f);
            mGameReference.aaDisplay.AddMenuUIElement(backButton);
        }
Exemplo n.º 10
0
        public UIElement_ScoreTextBox(Display pDisplay, GameWorld pGameWorld, int pPosX, int pPosY)
            : base(pDisplay, pGameWorld, "", pPosX, pPosY, 0, 0, 0, 0, 0, 0, 0, 0)
        {
            mAcceptPressed = false;
            mCancelPressed = false;
            mFont          = pDisplay.aaGame.mTextboxFont;
            mColor         = Color.White;
            mTextBox       = new UIElement_StaticMenuElement(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mTextBoxXOffset, pPosY + mTextBoxYOffset, 0, 0, Constants.LAYER_UI_FRONT, 0, 197, 301, 39, 0);
            mNameLabel     = new UIElement_StaticMenuElement(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mNameLabelXOffset, pPosY + mNameLabelYOffset, 0, 0, Constants.LAYER_UI_FRONT, 302, 197, 150, 39, 0);
            mAcceptButton  = new UIElement_MenuButton(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mAcceptButtonXOffset, pPosY + mAcceptButtonYOffset, 0, 0, Constants.LAYER_UI_FRONT, 0, 157, 100, 39, 0);
            mCancelButton  = new UIElement_MenuButton(pDisplay, pGameWorld, "Menu_MASTER", pPosX + mCancelButtonXOffset, pPosY + mCancelButtonYOffset, 0, 0, Constants.LAYER_UI_FRONT, 201, 157, 100, 39, 0);

            // Initialize the key dictionary
            characterByKey = new Dictionary <Keys, char>()
            {
                { Keys.A, 'a' },
                { Keys.B, 'b' },
                { Keys.C, 'c' },
                { Keys.D, 'd' },
                { Keys.E, 'e' },
                { Keys.F, 'f' },
                { Keys.G, 'g' },
                { Keys.H, 'h' },
                { Keys.I, 'i' },
                { Keys.J, 'j' },
                { Keys.K, 'k' },
                { Keys.L, 'l' },
                { Keys.M, 'm' },
                { Keys.N, 'n' },
                { Keys.O, 'o' },
                { Keys.P, 'p' },
                { Keys.Q, 'q' },
                { Keys.R, 'r' },
                { Keys.S, 's' },
                { Keys.T, 't' },
                { Keys.U, 'u' },
                { Keys.V, 'v' },
                { Keys.W, 'w' },
                { Keys.X, 'x' },
                { Keys.Y, 'y' },
                { Keys.Z, 'z' },
                { Keys.D0, '0' },
                { Keys.D1, '1' },
                { Keys.D2, '2' },
                { Keys.D3, '3' },
                { Keys.D4, '4' },
                { Keys.D5, '5' },
                { Keys.D6, '6' },
                { Keys.D7, '7' },
                { Keys.D8, '8' },
                { Keys.D9, '9' },
                { Keys.NumPad0, '0' },
                { Keys.NumPad1, '1' },
                { Keys.NumPad2, '2' },
                { Keys.NumPad3, '3' },
                { Keys.NumPad4, '4' },
                { Keys.NumPad5, '5' },
                { Keys.NumPad6, '6' },
                { Keys.NumPad7, '7' },
                { Keys.NumPad8, '8' },
                { Keys.NumPad9, '9' },
                { Keys.OemPeriod, '.' },
                { Keys.OemMinus, '-' },
                { Keys.Space, ' ' }
            };
            mTextBoxText      = new StringBuilder();
            mPreviousKeyState = Keyboard.GetState();
        }