/// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            environment.Draw(spriteBatch);
            scoreBoard.Draw(spriteBatch);

            spriteBatch.Begin();

            foreach (Bouncerang b in bouncerangs)
            {
                b.Draw(spriteBatch);
            }

            foreach (GameObject p in Projectiles)
            {
                if (p is Arrow)
                {
                    Arrow a = (Arrow)p;
                    a.Draw(spriteBatch);
                }
                else if (p is Bomb)
                {
                    Bomb a = (Bomb)p;
                    a.Draw(spriteBatch);
                }
                else if (p is Potion)
                {
                    Potion a = (Potion)p;
                    a.Draw(spriteBatch);
                }
            }
            foreach (Enemy e in Enemies)
            {
                e.Draw(spriteBatch);
            }


            link.Draw(spriteBatch);


            if (isGameOver)
            {
                spriteBatch.DrawString(fontBig, "Game Over...", new Vector2(220, 55), Color.White);
            }
            else
            if (showItemText && showItemTextCounter < 100)
            {
                spriteBatch.DrawString(fontBig, gotItemText, new Vector2(200, 55), Color.White);
                showItemTextCounter++;
            }
            spriteBatch.End();
            if (Paused)
            {
                menu.Draw(spriteBatch);
            }

            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
示例#2
0
        private void DrawLevelState(GameTime gameTime)
        {
            mainGame.GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();
            board.Draw(spriteBatch);

            stairs.Draw(spriteBatch);

            darwin.Draw(spriteBatch);
            firstZombie.Draw(spriteBatch);
            secondZombie.Draw(spriteBatch);
            thirdZombie.Draw(spriteBatch);
            fourthZombie.Draw(spriteBatch);
            cannibalZombie.Draw(spriteBatch);

            potion.Draw(spriteBatch);
            zTime.Draw(spriteBatch);

            if (!isAllZombiesDead())
            {
                foreach (BasicObject bo in removableWalls)
                {
                    // Draw the walls visible
                    Rectangle source = new Rectangle(0, 0, board.getSquareLength(), board.getSquareLength());
                    spriteBatch.Draw(removableWallTex, board.getPosition(bo), source, Color.White);
                }
            }


            foreach (BasicObject a in walls)
            {
                spriteBatch.Draw(wallTex, board.getPosition(a.X, a.Y), Color.White);
            }

            if (messageMode)
            {
                zombieMessage.Draw(spriteBatch, messageFont);
                darwinMessage.Draw(spriteBatch, messageFont);
                cannibalMessage.Draw(spriteBatch, messageFont);
            }

            spriteBatch.DrawString(messageFont, "HUMANITY: ",
                                   new Vector2(board.getPosition(zTime.X, zTime.Y).X + board.getSquareWidth() * 3 / 2, board.getPosition(zTime.X, 24).Y),
                                   Color.Black);

            spriteBatch.DrawString(messageFont, "DEATH COUNT: " + mainGame.DEATH_COUNTER.ToString(),
                                   new Vector2(board.getPosition(23, 24).X, board.getPosition(23, 24).Y),
                                   Color.Black);

            spriteBatch.End();
        }
示例#3
0
 public void DrawWithEffect(RLConsole inventoryConsole, RLConsole mapConsole)
 {
     Draw(inventoryConsole);
     if (Potions.Count() > 0)
     {
         Potion potion = Potions[Selection.SelectedItemIndex] as Potion;
         potion.Draw(inventoryConsole, 48, 6);
         if (potion.EffectCode == 2)
         {
             CellSelection.HighlightMonstersAround(Game.Player.Coord, 5, mapConsole);
         }
     }
 }
示例#4
0
        private void DrawLevelState(GameTime gameTime)
        {
            mainGame.GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();
            board.Draw(spriteBatch);
            stairs.Draw(spriteBatch);

            vortex.Draw(spriteBatch);
            darwin.Draw(spriteBatch);
            firstZombie.Draw(spriteBatch);
            secondZombie.Draw(spriteBatch);
            thirdZombie.Draw(spriteBatch);
            fourthZombie.Draw(spriteBatch);
            fifthZombie.Draw(spriteBatch);
            sixthZombie.Draw(spriteBatch);
            firstSwitch.Draw(spriteBatch);
            brain.Draw(spriteBatch);
            zTime.Draw(spriteBatch);
            potion.Draw(spriteBatch);

            if (messageMode)
            {
                zombieMessage.Draw(spriteBatch, messageFont);
                darwinMessage.Draw(spriteBatch, messageFont);
                brainMessage.Draw(spriteBatch, messageFont);
                //switchMessage.Draw(spriteBatch, messageFont);
            }

            foreach (BasicObject a in walls)
            {
                spriteBatch.Draw(wallTex, board.getPosition(a.X, a.Y), Color.White);
            }

            spriteBatch.DrawString(messageFont, "HUMANITY: ",
                                   new Vector2(board.getPosition(zTime.X, zTime.Y).X + board.getSquareWidth() * 3 / 2, board.getPosition(zTime.X, 24).Y),
                                   Color.Black);

            spriteBatch.DrawString(messageFont, "DEATH COUNT: " + mainGame.DEATH_COUNTER.ToString(),
                                   new Vector2(board.getPosition(23, 24).X, board.getPosition(23, 24).Y),
                                   Color.Black);

            spriteBatch.End();
        }
示例#5
0
        private void DrawLevelState(GameTime gameTime)
        {
            mainGame.GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();
            board.Draw(spriteBatch);

            pattern.Draw(spriteBatch);

            foreach (Vortex v in vortexes)
            {
                v.Draw(spriteBatch);
            }

            darwin.Draw(spriteBatch);

            zTime.Draw(spriteBatch);
            potion.Draw(spriteBatch);

            snake.Draw(spriteBatch);
            snake2.Draw(spriteBatch);
            snake3.Draw(spriteBatch);
            snake4.Draw(spriteBatch);

            northZombie.Draw(spriteBatch);
            southZombie.Draw(spriteBatch);
            eastZombie.Draw(spriteBatch);
            westZombie.Draw(spriteBatch);

            foreach (Flame flame in flames)
            {
                flame.Draw(spriteBatch, mainGame.Content.Load <Texture2D>("flame"));
            }

            if (messageMode)
            {
                zombieMessage.Draw(spriteBatch, messageFont);
                darwinMessage.Draw(spriteBatch, messageFont);
            }

            foreach (BasicObject a in walls)
            {
                spriteBatch.Draw(wallTex, board.getPosition(a.X, a.Y), Color.White);
            }

            foreach (Box b in boxes)
            {
                b.Draw(spriteBatch);
            }

            // only show the stairs after the pattern is complete
            if (pattern.isComplete(board, boxes))
            {
                if (pattern.shouldSparkle())
                {
                    //PUT THE SOUND HERE
                    if (playSound)
                    {
                        revealStairsSound.Play();
                        playSound = false;
                    }
                    Console.Out.WriteLine("here");

                    stairs.Draw(spriteBatch);
                    Rectangle rect   = stairs.destination;
                    Rectangle source = new Rectangle(0, 0, 100, 100);
                    if (pattern.getSparkleCount() >= 0 && pattern.getSparkleCount() < 25)
                    {
                        rect.Height = 100;
                        rect.Width  = 100;
                        rect.X     -= 30;
                        rect.Y     -= 50;

                        spriteBatch.Draw(sparkleTex, rect, source, Color.White);
                    }
                    else if (pattern.getSparkleCount() >= 25 && pattern.getSparkleCount() < 50)
                    {
                        rect.Height = 100;
                        rect.Width  = 100;
                        rect.X     -= 30;
                        rect.Y     -= 50;

                        source.X = 100;

                        spriteBatch.Draw(sparkleTex, rect, source, Color.White);
                    }
                    else if (pattern.getSparkleCount() >= 50)
                    {
                        rect.Height = 100;
                        rect.Width  = 100;
                        rect.X     -= 30;
                        rect.Y     -= 50;

                        source.X = 200;

                        spriteBatch.Draw(sparkleTex, rect, source, Color.White);
                    }
                }
                else
                {
                    stairs.Draw(spriteBatch);
                }
            }

            spriteBatch.DrawString(messageFont, "HUMANITY: ",
                                   new Vector2(board.getPosition(zTime.X, zTime.Y).X + board.getSquareWidth() * 3 / 2, board.getPosition(zTime.X, 24).Y),
                                   Color.Black);

            spriteBatch.DrawString(messageFont, "DEATH COUNT: " + mainGame.DEATH_COUNTER.ToString(),
                                   new Vector2(board.getPosition(23, 24).X, board.getPosition(23, 24).Y),
                                   Color.Black);

            spriteBatch.End();
        }