/// <summary> /// Returns an exact copy of the object. /// </summary> public override GameObj Clone() { //Sets common variables. MazeELight newBlock = new MazeELight(game, X, Y, Layer); newBlock.ActionIndex = ActionIndex; newBlock.ActionIndex2 = ActionIndex2; newBlock.ActionType = ActionType; newBlock.CustInt1 = CustInt1; newBlock.CustInt2 = CustInt2; newBlock.CustStr = CustStr; newBlock.BlockDir = BlockDir; newBlock.IsActivated = IsActivated; newBlock.IsEnabled = IsEnabled; newBlock.IsVisible = IsVisible; newBlock.BlockSprite = BlockSprite; //Sets custom variables. newBlock.spriteAtlas = new SpriteAtlas(spriteAtlas, false); return(newBlock); }
///<summary> ///Loads relevant graphics into memory. /// /// Dependencies: MainLoop.cs, maze block textures. /// </summary> public void LoadContent(ContentManager Content) { //Loads relevant assets. sndCheckpoint = Content.Load <SoundEffect>("Content/Sounds/sndCheckpoint"); sndFinish = Content.Load <SoundEffect>("Content/Sounds/sndFinish"); sndHit = Content.Load <SoundEffect>("Content/Sounds/sndHit"); sndWin = Content.Load <SoundEffect>("Content/Sounds/sndWin"); TexPixel = new Texture2D(game.GraphicsDevice, 1, 1); TexPixel.SetData(new Color[] { Color.White }); TexMenuHud = game.Content.Load <Texture2D>("Content/Sprites/Gui/sprMenuHud"); //Sets up hud sprites. sprHudOverlay = new Sprite(true, TexPixel); sprHudOverlay.color = Color.Gray; sprHudOverlay.alpha = 0.5f; sprHudOverlay.rectDest = new SmoothRect (0, game.GetScreenSize().Y - 32, game.GetScreenSize().X, 32); sprMenuHud = new Sprite(true, TexMenuHud); sprMenuHud.rectDest = new SmoothRect (0, game.GetScreenSize().Y - 32, 64, 32); //Loads all maze block textures. GameObj._LoadContent(game.Content); //base class. MazeActor.LoadContent(game.Content); MazeBelt.LoadContent(game.Content); MazeCoin.LoadContent(game.Content); MazeCoinLock.LoadContent(game.Content); MazeCrate.LoadContent(game.Content); MazeCrateHole.LoadContent(game.Content); MazeEnemy.LoadContent(game.Content); MazeFilter.LoadContent(game.Content); MazeFloor.LoadContent(game.Content); MazeFreeze.LoadContent(game.Content); MazeGate.LoadContent(game.Content); MazeHealth.LoadContent(game.Content); MazeIce.LoadContent(game.Content); MazeKey.LoadContent(game.Content); MazeLaserActuator.LoadContent(game.Content); MazeLock.LoadContent(game.Content); MazeMultiWay.LoadContent(game.Content); MazePanel.LoadContent(game.Content); MazeSpawner.LoadContent(game.Content); MazeSpike.LoadContent(game.Content); MazeStairs.LoadContent(game.Content); MazeTeleporter.LoadContent(game.Content); MazeThaw.LoadContent(game.Content); MazeWall.LoadContent(game.Content); MazeCheckpoint.LoadContent(game.Content); MazeEPusher.LoadContent(game.Content); MazeELight.LoadContent(game.Content); MazeEAuto.LoadContent(game.Content); MazeGoal.LoadContent(game.Content); MazeFinish.LoadContent(game.Content); MazeMessage.LoadContent(game.Content); MazeClick.LoadContent(game.Content); MazeRotate.LoadContent(game.Content); MazeTurret.LoadContent(game.Content); MazeTurretBullet.LoadContent(game.Content); MazeMirror.LoadContent(game.Content); }