Ejemplo n.º 1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();
            currentLevel.DrawBG(spriteBatch, windowWidth, windowHeight);
            foreach (Cat c in currentLevel.cats)
            {
                c.Draw(spriteBatch);
            }
            angel.Draw(spriteBatch);
            foreach (Obstacle o in currentLevel.obstacles)
            {
                o.Draw(spriteBatch);
            }
            currentLevel.DrawFG(spriteBatch, windowWidth, windowHeight);
            if (explosion.Count > 0)
            {
                foreach (ExplosionParticle e in explosion)
                {
                    e.Draw(spriteBatch);
                }
            }
            HUDCat.Draw(spriteBatch);
            spriteBatch.DrawString(font, catCount.ToString(), new Vector2(35, 2), Color.White);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Ejemplo n.º 2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin();
            if (!endGame)
            {
                currentLevel.DrawBG(spriteBatch, windowWidth, windowHeight);
                if (videoPlayer.State == MediaState.Playing)
                {
                    spriteBatch.Draw(videoPlayer.GetTexture(), new Rectangle(0, 0, windowWidth, windowHeight), Color.White);
                }
                if (currentLevel.gem != null)
                {
                    currentLevel.gem.Draw(spriteBatch);
                }
                foreach (Button b in currentLevel.buttons)
                {
                    b.Draw(spriteBatch);
                }
                foreach (Timer t in currentLevel.timers)
                {
                    t.Draw(spriteBatch);
                }
                angel.Draw(spriteBatch);
                foreach (Fish f in currentLevel.fish)
                {
                    f.Draw(spriteBatch);
                }
                foreach (FallingRock o in currentLevel.rocks)
                {
                    o.Draw(spriteBatch);
                }
                foreach (RocketLauncher r in currentLevel.launchers)
                {
                    r.Draw(spriteBatch);
                    r.rocket.Draw(spriteBatch);
                }
                if (currentLevel != levels[0, 0] && currentLevel != levels[5, 5])
                {
                    currentLevel.DrawFG(spriteBatch, windowWidth, windowHeight);
                }
                else
                {
                    foreach (Wall w in currentLevel.walls)
                    {
                        w.Draw(pixel, spriteBatch);
                    }
                }
                foreach (ElectricFence e in currentLevel.fences)
                {
                    e.Draw(spriteBatch);
                }
                if (currentLevel.coordinates.X == 0 && currentLevel.coordinates.Y == 10)
                {
                    foreach (ElectricFence e in finalFences)
                    {
                        e.Draw(spriteBatch);
                    }
                }
                foreach (SpinningPlasma p in currentLevel.plasmas)
                {
                    p.Draw(spriteBatch);
                }
                foreach (Starfish s in currentLevel.starfish)
                {
                    s.Draw(spriteBatch);
                }
                foreach (Bubbles b in currentLevel.bubbles)
                {
                    b.Draw(spriteBatch);
                }
                foreach (Cat c in currentLevel.cats)
                {
                    c.Draw(spriteBatch);
                }
                if (deathExplosion != null)
                {
                    deathExplosion.Draw(spriteBatch);
                }
                if (gemExplosion != null)
                {
                    gemExplosion.Draw(spriteBatch);
                }
                foreach (RocketLauncher r in currentLevel.launchers)
                {
                    if (r.explosion != null)
                    {
                        r.explosion.Draw(spriteBatch);
                    }
                }
                HUDCat.Draw(spriteBatch);
                spriteBatch.DrawString(font, catCount.ToString(), new Vector2(35, 2), Color.White);
            }
            else
            {
                spriteBatch.DrawString(font,
                                       "             CAT PLANET 2\n" +
                                       "               CREDITS\n\n" +
                                       "Programming Graphics Music Design Everything\n" +
                                       "              Tad Cordle\n\n" +
                                       "Except Fish Lair's Music's tune. That was by\n" +
                                       "              Alan Kahn\n\n" +
                                       "              Tools Used\n" +
                                       "       XNA 4.0 for Visual Studio 2010\n" +
                                       "              Sibelius 7\n" +
                                       "              Flash CS5\n\n" +
                                       "       Sound Effects from flashkit.com\n\n" +
                                       "            Special Thanks\n" +
                                       "                Nobody\n\n" +
                                       "         Cats Collected: " + catCount.ToString() + "/" + cats.Count().ToString() + "\n" +
                                       "              Time: " + seconds.Minutes.ToString() + ":" + (seconds.Seconds < 10 ? "0" : "") + seconds.Seconds + "\n" +
                                       "            Deaths: " + deaths.ToString() + "\n" +
                                       "             Jumps: " + wingFlaps.ToString() + "\n\n" +
                                       "        THANKS FOR PLAYING AND STUFF",
                                       creditPosition, Color.White);
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }