public override void Dispose() { if (!base.IsDisposed) { Console.WriteLine("Disposing Procedural Level Screen"); Tween.StopAll(false); this.m_currentRoom = null; this.DisposeRTs(); foreach (RoomObj current in this.m_roomList) { current.Dispose(); } this.m_roomList.Clear(); this.m_roomList = null; this.m_enemyStartPositions.Clear(); this.m_enemyStartPositions = null; this.m_tempEnemyStartPositions.Clear(); this.m_tempEnemyStartPositions = null; this.m_textManager.Dispose(); this.m_textManager = null; this.m_physicsManager = null; this.m_projectileManager.Dispose(); this.m_projectileManager = null; this.m_itemDropManager.Dispose(); this.m_itemDropManager = null; this.m_currentRoom = null; this.m_miniMapDisplay.Dispose(); this.m_miniMapDisplay = null; this.m_mapBG.Dispose(); this.m_mapBG = null; this.m_inputMap.Dispose(); this.m_inputMap = null; this.m_lastEnemyHit = null; this.m_playerHUD.Dispose(); this.m_playerHUD = null; this.m_player = null; this.m_enemyHUD.Dispose(); this.m_enemyHUD = null; this.m_impactEffectPool.Dispose(); this.m_impactEffectPool = null; this.m_blackBorder1.Dispose(); this.m_blackBorder1 = null; this.m_blackBorder2.Dispose(); this.m_blackBorder2 = null; this.m_chestList.Clear(); this.m_chestList = null; this.m_projectileIconPool.Dispose(); this.m_projectileIconPool = null; this.m_objKilledPlayer = null; this.m_dungeonLight.Dispose(); this.m_dungeonLight = null; this.m_traitAura.Dispose(); this.m_traitAura = null; this.m_killedEnemyObjList.Clear(); this.m_killedEnemyObjList = null; this.m_roomEnteringTitle.Dispose(); this.m_roomEnteringTitle = null; this.m_roomTitle.Dispose(); this.m_roomTitle = null; this.m_creditsText.Dispose(); this.m_creditsText = null; this.m_creditsTitleText.Dispose(); this.m_creditsTitleText = null; Array.Clear(this.m_creditsTextTitleList, 0, this.m_creditsTextTitleList.Length); Array.Clear(this.m_creditsTextList, 0, this.m_creditsTextList.Length); this.m_creditsTextTitleList = null; this.m_creditsTextList = null; this.m_filmGrain.Dispose(); this.m_filmGrain = null; this.m_objectivePlate.Dispose(); this.m_objectivePlate = null; this.m_objectivePlateTween = null; this.m_sky.Dispose(); this.m_sky = null; this.m_whiteBG.Dispose(); this.m_whiteBG = null; this.m_compassBG.Dispose(); this.m_compassBG = null; this.m_compass.Dispose(); this.m_compass = null; if (this.m_compassDoor != null) { this.m_compassDoor.Dispose(); } this.m_compassDoor = null; this.m_castleBorderTexture.Dispose(); this.m_gardenBorderTexture.Dispose(); this.m_towerBorderTexture.Dispose(); this.m_dungeonBorderTexture.Dispose(); this.m_neoBorderTexture.Dispose(); this.m_castleBorderTexture = null; this.m_gardenBorderTexture = null; this.m_towerBorderTexture = null; this.m_dungeonBorderTexture = null; this.DebugTextObj.Dispose(); this.DebugTextObj = null; base.Dispose(); } }
public override void OnEnter() { this.m_allowExit = false; float num = Game.PlayerStats.TotalHoursPlayed + Game.GetTotalGameTimeHours(); int num2 = (int)((num - (float)((int)num)) * 60f); Console.WriteLine(string.Concat(new object[] { "Hours played: ", num, " minutes: ", num2 })); this.m_totalDeaths.Text = "Total Children: " + Game.PlayerStats.TimesDead.ToString(); if (num2 < 10) { this.m_totalPlayTime.Text = string.Concat(new object[] { "Time Played - ", (int)num, ":0", num2 }); } else { this.m_totalPlayTime.Text = string.Concat(new object[] { "Time Played - ", (int)num, ":", num2 }); } base.Camera.Position = Vector2.Zero; this.m_displayingContinueText = false; this.m_continueText.Text = "Press [Input:" + 0 + "] to exit"; if (this.m_sky == null) { this.m_sky = new SkyObj(null); this.m_skyRenderTarget = new RenderTarget2D(base.Camera.GraphicsDevice, 1320, 720); this.m_sky.LoadContent(base.Camera); this.m_backgroundRenderTarget = new RenderTarget2D(base.Camera.GraphicsDevice, 1320, 720); } this.SetPlayerStyle("Walking"); if (!this.IsEnding) { SoundManager.PlayMusic("CreditsSong", true, 1f); } this.m_scrollDistance = -(this.m_creditsNameList[this.m_creditsNameList.Count - 1].Y + 100f); foreach (TextObj current in this.m_creditsTitleList) { Tween.By(current, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); } foreach (TextObj current2 in this.m_creditsNameList) { Tween.By(current2, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); } Tween.By(this.m_teddy, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); Tween.By(this.m_kenny, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); Tween.By(this.m_glauber, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); Tween.By(this.m_gordon, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); Tween.By(this.m_judson, 75f, new Easing(Tween.EaseNone), new string[] { "Y", this.m_scrollDistance.ToString() }); if (!this.IsEnding) { this.m_sideBorderLeft.X += 200f; this.m_sideBorderRight.X -= 200f; Tween.RunFunction(76f, this, "ResetScroll", new object[0]); } base.OnEnter(); }
public override void LoadContent() { this.DebugTextObj = new TextObj(Game.JunicodeFont); this.DebugTextObj.FontSize = 26f; this.DebugTextObj.Align = Types.TextAlign.Centre; this.DebugTextObj.Text = ""; this.DebugTextObj.ForceDraw = true; this.m_projectileIconPool = new ProjectileIconPool(200, this.m_projectileManager, base.ScreenManager as RCScreenManager); this.m_projectileIconPool.Initialize(); this.m_textManager.Initialize(); this.m_impactEffectPool.Initialize(); this.m_physicsManager = (base.ScreenManager.Game as Game).PhysicsManager; this.m_physicsManager.SetGravity(0f, 1830f); this.m_projectileManager.Initialize(); this.m_physicsManager.Initialize(base.ScreenManager.Camera); this.m_itemDropManager = new ItemDropManager(600, this.m_physicsManager); this.m_itemDropManager.Initialize(); this.m_playerHUD = new PlayerHUDObj(); this.m_playerHUD.SetPosition(new Vector2(20f, 40f)); this.m_enemyHUD = new EnemyHUDObj(); this.m_enemyHUD.Position = new Vector2((float)(660 - this.m_enemyHUD.Width / 2), 20f); this.m_miniMapDisplay.SetPlayer(this.m_player); this.m_miniMapDisplay.InitializeAlphaMap(new Rectangle(1070, 50, 200, 100), base.Camera); this.InitializeAllRooms(true); this.InitializeEnemies(); this.InitializeChests(true); this.InitializeRenderTargets(); this.m_mapBG = new SpriteObj("MinimapBG_Sprite"); this.m_mapBG.Position = new Vector2(1070f, 50f); this.m_mapBG.ForceDraw = true; this.UpdateCamera(); this.m_borderSize = 100; this.m_blackBorder1 = new SpriteObj("Blank_Sprite"); this.m_blackBorder1.TextureColor = Color.Black; this.m_blackBorder1.Scale = new Vector2(1340f / (float)this.m_blackBorder1.Width, (float)(this.m_borderSize / this.m_blackBorder1.Height)); this.m_blackBorder2 = new SpriteObj("Blank_Sprite"); this.m_blackBorder2.TextureColor = Color.Black; this.m_blackBorder2.Scale = new Vector2(1340f / (float)this.m_blackBorder2.Width, (float)(this.m_borderSize / this.m_blackBorder2.Height)); this.m_blackBorder1.ForceDraw = true; this.m_blackBorder2.ForceDraw = true; this.m_blackBorder1.Y = (float)(-(float)this.m_borderSize); this.m_blackBorder2.Y = 720f; this.m_dungeonLight = new SpriteObj("LightSource_Sprite"); this.m_dungeonLight.ForceDraw = true; this.m_dungeonLight.Scale = new Vector2(12f, 12f); this.m_traitAura = new SpriteObj("LightSource_Sprite"); this.m_traitAura.ForceDraw = true; this.m_objectivePlate = new ObjContainer("DialogBox_Character"); this.m_objectivePlate.ForceDraw = true; TextObj textObj = new TextObj(Game.JunicodeFont); textObj.Position = new Vector2(-400f, -60f); textObj.OverrideParentScale = true; textObj.FontSize = 10f; textObj.Text = "Fairy Chest Objective:"; textObj.TextureColor = Color.Red; textObj.OutlineWidth = 2; this.m_objectivePlate.AddChild(textObj); TextObj textObj2 = new TextObj(Game.JunicodeFont); textObj2.OverrideParentScale = true; textObj2.Position = new Vector2(textObj.X, textObj.Y + 40f); textObj2.ForceDraw = true; textObj2.FontSize = 9f; textObj2.Text = "Reach the chest in 15 seconds:"; textObj2.WordWrap(250); textObj2.OutlineWidth = 2; this.m_objectivePlate.AddChild(textObj2); TextObj textObj3 = new TextObj(Game.JunicodeFont); textObj3.OverrideParentScale = true; textObj3.Position = new Vector2(textObj2.X, textObj2.Y + 35f); textObj3.ForceDraw = true; textObj3.FontSize = 9f; textObj3.Text = "Time Remaining:"; textObj3.WordWrap(250); textObj3.OutlineWidth = 2; this.m_objectivePlate.AddChild(textObj3); this.m_objectivePlate.Scale = new Vector2(250f / (float)this.m_objectivePlate.GetChildAt(0).Width, 130f / (float)this.m_objectivePlate.GetChildAt(0).Height); this.m_objectivePlate.Position = new Vector2(1470f, 250f); SpriteObj spriteObj = new SpriteObj("Blank_Sprite"); spriteObj.TextureColor = Color.Red; spriteObj.Position = new Vector2(textObj2.X, textObj2.Y + 20f); spriteObj.ForceDraw = true; spriteObj.OverrideParentScale = true; spriteObj.ScaleY = 0.5f; this.m_objectivePlate.AddChild(spriteObj); SpriteObj spriteObj2 = new SpriteObj("Blank_Sprite"); spriteObj2.TextureColor = Color.Red; spriteObj2.Position = new Vector2(textObj2.X, spriteObj.Y + 35f); spriteObj2.ForceDraw = true; spriteObj2.OverrideParentScale = true; spriteObj2.ScaleY = 0.5f; this.m_objectivePlate.AddChild(spriteObj2); base.LoadContent(); this.m_sky = new SkyObj(this); this.m_sky.LoadContent(base.Camera); this.m_whiteBG = new SpriteObj("Blank_Sprite"); this.m_whiteBG.Opacity = 0f; this.m_whiteBG.Scale = new Vector2(1320f / (float)this.m_whiteBG.Width, 720f / (float)this.m_whiteBG.Height); this.m_filmGrain = new SpriteObj("FilmGrain_Sprite"); this.m_filmGrain.ForceDraw = true; this.m_filmGrain.Scale = new Vector2(2.015f, 2.05f); this.m_filmGrain.X -= 5f; this.m_filmGrain.Y -= 5f; this.m_filmGrain.PlayAnimation(true); this.m_filmGrain.AnimationDelay = 0.0333333351f; this.m_compassBG = new SpriteObj("CompassBG_Sprite"); this.m_compassBG.ForceDraw = true; this.m_compassBG.Position = new Vector2(660f, 90f); this.m_compassBG.Scale = Vector2.Zero; this.m_compass = new SpriteObj("Compass_Sprite"); this.m_compass.Position = this.m_compassBG.Position; this.m_compass.ForceDraw = true; this.m_compass.Scale = Vector2.Zero; this.InitializeCreditsText(); }
public override void Dispose() { if (!base.IsDisposed) { Console.WriteLine("Disposing Credits Screen"); Array.Clear(this.m_backgroundStrings, 0, this.m_backgroundStrings.Length); this.m_backgroundStrings = null; this.m_playerSprite.Dispose(); this.m_playerSprite = null; this.m_wifeSprite.Dispose(); this.m_wifeSprite = null; this.m_childSprite1.Dispose(); this.m_childSprite1 = null; this.m_childSprite2.Dispose(); this.m_childSprite2 = null; this.m_manor.Dispose(); this.m_manor = null; this.m_thanksForPlayingText.Dispose(); this.m_thanksForPlayingText = null; this.m_sideBorderRight.Dispose(); this.m_sideBorderRight = null; this.m_sideBorderLeft.Dispose(); this.m_sideBorderLeft = null; this.m_sideBorderTop.Dispose(); this.m_sideBorderTop = null; this.m_sideBorderBottom.Dispose(); this.m_sideBorderBottom = null; this.m_bgOutside.Dispose(); this.m_bgOutside = null; this.m_sky.Dispose(); this.m_sky = null; this.m_skyRenderTarget.Dispose(); this.m_skyRenderTarget = null; this.m_backgroundRenderTarget.Dispose(); this.m_backgroundRenderTarget = null; foreach (TextObj current in this.m_creditsTitleList) { current.Dispose(); } this.m_creditsTitleList.Clear(); this.m_creditsTitleList = null; foreach (TextObj current2 in this.m_creditsNameList) { current2.Dispose(); } this.m_creditsNameList.Clear(); this.m_creditsNameList = null; this.m_bg1.Dispose(); this.m_bg2.Dispose(); this.m_bg3.Dispose(); this.m_ground1.Dispose(); this.m_ground2.Dispose(); this.m_ground3.Dispose(); this.m_border1.Dispose(); this.m_border2.Dispose(); this.m_border3.Dispose(); this.m_prop1.Dispose(); this.m_prop2.Dispose(); this.m_prop3.Dispose(); this.m_prop1 = null; this.m_prop2 = null; this.m_prop3 = null; this.m_bg1 = null; this.m_bg2 = null; this.m_bg3 = null; this.m_ground1 = null; this.m_ground2 = null; this.m_ground3 = null; this.m_border1 = null; this.m_border2 = null; this.m_border3 = null; this.m_teddy.Dispose(); this.m_kenny.Dispose(); this.m_glauber.Dispose(); this.m_gordon.Dispose(); this.m_judson.Dispose(); this.m_teddy = null; this.m_kenny = null; this.m_glauber = null; this.m_gordon = null; this.m_judson = null; this.m_continueText.Dispose(); this.m_continueText = null; this.m_totalDeaths.Dispose(); this.m_totalDeaths = null; this.m_totalPlayTime.Dispose(); this.m_totalPlayTime = null; base.Dispose(); } }