public override void Draw(GameTime gameTime) { spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); spriteBatch.Draw(basic, backgroundRect, Color.LightCyan); spriteBatch.Draw(background, backgroundRect, Color.White); spriteBatch.Draw(grid, new Vector2(350, 150), Color.White); foreach (Brick s in spriteList) s.Draw(gameTime, spriteBatch); dest1.Draw(gameTime, spriteBatch); dest2.Draw(gameTime, spriteBatch); dest3.Draw(gameTime, spriteBatch); dest4.Draw(gameTime, spriteBatch); dest5.Draw(gameTime, spriteBatch); dest6.Draw(gameTime, spriteBatch); saviour.Draw(gameTime, spriteBatch); goal1.Draw(gameTime, spriteBatch); goal2.Draw(gameTime, spriteBatch); goal3.Draw(gameTime, spriteBatch); goal4.Draw(gameTime, spriteBatch); goal5.Draw(gameTime, spriteBatch); goal6.Draw(gameTime, spriteBatch); if (goal1.collisionRect.Equals(dest1.collisionRect) || goal1.collisionRect.Equals(dest2.collisionRect) || goal1.collisionRect.Equals(dest3.collisionRect) || goal1.collisionRect.Equals(dest4.collisionRect) || goal1.collisionRect.Equals(dest5.collisionRect) || goal1.collisionRect.Equals(dest6.collisionRect)) { spriteBatch.Draw(final1, goal1.collisionRect, Color.Red); a = true; } if (goal2.collisionRect.Equals(dest1.collisionRect) || goal2.collisionRect.Equals(dest2.collisionRect) || goal2.collisionRect.Equals(dest3.collisionRect) || goal2.collisionRect.Equals(dest4.collisionRect) || goal2.collisionRect.Equals(dest5.collisionRect) || goal2.collisionRect.Equals(dest6.collisionRect)) { spriteBatch.Draw(final2, goal2.collisionRect, Color.Red); b = true; } if (goal3.collisionRect.Equals(dest1.collisionRect) || goal3.collisionRect.Equals(dest2.collisionRect) || goal3.collisionRect.Equals(dest3.collisionRect) || goal3.collisionRect.Equals(dest4.collisionRect) || goal3.collisionRect.Equals(dest5.collisionRect) || goal3.collisionRect.Equals(dest6.collisionRect)) { spriteBatch.Draw(final3, goal3.collisionRect, Color.Red); c = true; } if (goal4.collisionRect.Equals(dest1.collisionRect) || goal4.collisionRect.Equals(dest2.collisionRect) || goal4.collisionRect.Equals(dest3.collisionRect) || goal4.collisionRect.Equals(dest4.collisionRect) || goal4.collisionRect.Equals(dest5.collisionRect) || goal4.collisionRect.Equals(dest6.collisionRect)) { spriteBatch.Draw(final4, goal4.collisionRect, Color.Red); d = true; } if (goal5.collisionRect.Equals(dest1.collisionRect) || goal5.collisionRect.Equals(dest2.collisionRect) || goal5.collisionRect.Equals(dest3.collisionRect) || goal5.collisionRect.Equals(dest4.collisionRect) || goal5.collisionRect.Equals(dest5.collisionRect) || goal5.collisionRect.Equals(dest6.collisionRect)) { spriteBatch.Draw(final5, goal5.collisionRect, Color.Red); e = true; } if (goal6.collisionRect.Equals(dest1.collisionRect) || goal6.collisionRect.Equals(dest2.collisionRect) || goal6.collisionRect.Equals(dest3.collisionRect) || goal6.collisionRect.Equals(dest4.collisionRect) || goal6.collisionRect.Equals(dest5.collisionRect) || goal6.collisionRect.Equals(dest6.collisionRect)) { spriteBatch.Draw(final5, goal6.collisionRect, Color.Red); f = true; } if (a && b && c && d && e && f) { go = true; } spriteBatch.Draw(stepImage, new Vector2(900, 400), Color.White); spriteBatch.Draw(homeImage, homeRect, Color.White); spriteBatch.Draw(retryImage, retryRect, Color.White); spriteBatch.Draw(arrow, arr_position, Color.White); if (((Game1)Game).chances4 > 0) { spriteBatch.Draw(mdg8, new Vector2(50, 400), Color.White); } else if (((Game1)Game).chances4 <= 0) { spriteBatch.Draw(lifeno, new Vector2(50, 400), Color.White); } spriteBatch.DrawString(stepFont, "Steps: " + steps, new Vector2(1025, 500), Color.Brown, 0, new Vector2(0, 0), 1, SpriteEffects.None, 1); if (isRetry) { saviour = new SaviourBrick(Game.Content.Load<Texture2D>(@"Images/saviours"), new Vector2(450, 350), 0, new Point(50, 50), new Point(0, 0), new Point(4, 4), 0); goal1 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(500,300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal2 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(500,350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal3 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(500,400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal4 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(650,300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal5 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(600, 350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal6 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(650, 400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); steps = -1; isRetry = false; } spriteBatch.End(); base.Draw(gameTime); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(Game.GraphicsDevice); stepFont = Game.Content.Load<SpriteFont>(@"Fonts\Snap"); mdg8 = Game.Content.Load<Texture2D>(@"Images\yeslife"); lifeno = Game.Content.Load<Texture2D>(@"Images\nolife"); audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb"); //--------------------------------------------------------- saviour = new SaviourBrick(Game.Content.Load<Texture2D>(@"Images/saviours"), new Vector2(450,350), 0, new Point(50, 50), new Point(0, 0), new Point(4, 4), 0); //-----------------------ROW 1 ----------------------------------------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(450, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(500, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(550, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(600, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(650, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(700, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 150), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //-----------------------ROW 2 ----------------------------------------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(450, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(500, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(550, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(600, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(650, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(700, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 200), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //-----------------------ROW SECOND LAST ----------------------------------------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(450, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(500, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(550, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(600, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(650, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(700, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 500), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //-----------------------ROW LAST ----------------------------------------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(450, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(500, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(550, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(600, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(650, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(700, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 550), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //--------------------------------------COLUMN 1 ------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 250), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(350, 450), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //--------------------------------------COLUMN 2 ------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 250), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(400, 450), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //--------------------------------------COLUMN LAST ------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 250), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(750, 450), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //-------------------------------OTHER FIXED BLOCKS------------------- spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(550,250), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(550,450), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); spriteList.Add(new FixedBrick( Game.Content.Load<Texture2D>(@"Images/brick"), new Vector2(700, 350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1))); //----------------------------------------------------- goal1 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(500,300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal2 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(500,350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal3 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(500,400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal4 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(650, 300), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal5 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(600, 350), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); goal6 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/mdg5"), new Vector2(650, 400), 0, new Point(50, 50), new Point(0, 0), new Point(1, 1)); //----------------------------------------------------------- dest1 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/weakness"), new Vector2(550, 300), 50, new Point(50, 50), new Point(0, 0), new Point(1, 1)); dest2 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/weakness"), new Vector2(550, 350), 50, new Point(50, 50), new Point(0, 0), new Point(1, 1)); dest3 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/weakness"), new Vector2(550, 400), 50, new Point(50, 50), new Point(0, 0), new Point(1, 1)); dest4 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/weakness"), new Vector2(600, 300), 50, new Point(50, 50), new Point(0, 0), new Point(1, 1)); dest5 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/weakness"), new Vector2(600,350), 50, new Point(50, 50), new Point(0, 0), new Point(1, 1)); dest6 = new GoalBrick( Game.Content.Load<Texture2D>(@"Images/weakness"), new Vector2(600, 400), 50, new Point(50, 50), new Point(0, 0), new Point(1, 1)); //-------------------------------------------------- final1 = Game.Content.Load<Texture2D>(@"Images/mdg5"); final2 = Game.Content.Load<Texture2D>(@"Images/mdg5"); final3 = Game.Content.Load<Texture2D>(@"Images/mdg5"); final4 = Game.Content.Load<Texture2D>(@"Images/mdg5"); final5 = Game.Content.Load<Texture2D>(@"Images/mdg5"); final6 = Game.Content.Load<Texture2D>(@"Images/mdg5"); win = Game.Content.Load<Texture2D>(@"Images/win"); arrow = Game.Content.Load<Texture2D>(@"Images/arrow"); stepImage = Game.Content.Load<Texture2D>(@"Images/steps"); homeImage = Game.Content.Load<Texture2D>(@"Images/home"); retryImage = Game.Content.Load<Texture2D>(@"Images/retry"); background = Game.Content.Load<Texture2D>(@"Images\bg8"); grid = Game.Content.Load<Texture2D>(@"Images\grid"); front = Game.Content.Load<SpriteFont>(@"Fonts\Snap"); saviourBack = Game.Content.Load<Texture2D>(@"Images\saviourback"); basic = Game.Content.Load<Texture2D>(@"Images\basic"); base.LoadContent(); }