Пример #1
0
        private void DrawLevelState(GameTime gameTime)
        {
            mainGame.GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();

            board.Draw(spriteBatch);

            stairs.Draw(spriteBatch);

            if (!fatBossZombie.eatingDarwin)
            {
                darwin.Draw(spriteBatch);
            }

            zTime.Draw(spriteBatch);

            nurseryOne.Draw(spriteBatch);
            nurseryTwo.Draw(spriteBatch);

            if (fatBossZombie.isZombieAlive())
            {
                fatBossZombie.Draw(spriteBatch);
            }

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

            if (messageMode)
            {
            }

            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();
        }
Пример #2
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();
        }