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(); }
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(); }
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; }
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); }
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 }
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); }