Example #1
0
        /// <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)
        {
            GraphicsDevice.Clear(Color.DeepSkyBlue);



            // TODO: Add your drawing code here
            spriteBatch.Begin();

            scrollBack.Draw(spriteBatch);
            scrollFore.Draw(spriteBatch);
            particleList.Draw(spriteBatch);
            spritePlayer.Draw(spriteBatch);
            enemyList.Draw(spriteBatch);
            playerBulletList.Draw(spriteBatch);
            textScore.Draw(spriteBatch);

            //enter to start text
            if (!startGame)
            {
                textStartGame.Draw(spriteBatch);
            }

            //display bounding boxes
            if (showbb)
            {
                spritePlayer.drawBB(spriteBatch, Color.Red);
                LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Purple);
                enemyList.drawInfo(spriteBatch, Color.Red, Color.Blue);
                playerBulletList.drawInfo(spriteBatch, Color.Red, Color.Blue);
            }

            spriteBatch.End();
            base.Draw(gameTime);
        }
Example #2
0
        /// <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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            spriteBatch.Begin();


            back1.Draw(spriteBatch);  //***
            grass1.Draw(spriteBatch);
            paddle.Draw(spriteBatch); //***
            enemyList.Draw(spriteBatch);
            ballList.Draw(spriteBatch);
            booms.Draw(spriteBatch);
            spriteBatch.DrawString(font, "Enemies Slain: " + score, new Vector2(rhs - 140, top + 10), Color.Black);

            if (showbb)
            {
                paddle.drawBB(spriteBatch, Color.Black);
                paddle.drawHS(spriteBatch, Color.Green);


                enemyList.drawInfo(spriteBatch, Color.Red, Color.Yellow);
                LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue);
                ballList.drawInfo(spriteBatch, Color.Gray, Color.Green);
            }



            spriteBatch.End();


            base.Draw(gameTime);
        }
Example #3
0
 public void Draw(GameTime gameTime)
 {
     if (currentAnimationList == null)
     {
         return;
     }
     currentAnimationList.Draw(gameTime, Position);
 }
Example #4
0
        public override void Draw(GameTime gameTime)
        {
            graphicsDevice.Clear(Color.DeepSkyBlue);



            // TODO: Add your drawing code here
            spriteBatch.Begin();



            scrollBack.colour = Color.Aqua;
            scrollBack.Draw(spriteBatch);
            scrollFore.Draw(spriteBatch);
            particleList.Draw(spriteBatch);
            player.Draw(spriteBatch);
            enemyList.Draw(spriteBatch);
            playerBulletList.Draw(spriteBatch);
            textScore.Draw(spriteBatch);


            //display bounding boxes
            if (Game1.showbb)
            {
                player.drawBB(spriteBatch, Color.Red);
                LineBatch.drawLineRectangle(spriteBatch, player.playArea, Color.Purple);
                enemyList.drawInfo(spriteBatch, Color.Red, Color.Blue);
                playerBulletList.drawInfo(spriteBatch, Color.Red, Color.Blue);
            }

            switch (levelState)
            {
            case LEVELSTATE.LEVELSTART:
                textVarious = new TextRenderable("LEVEL: " + level.ToString(), new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2), spriteFont, Color.Red);
                textVarious.Draw(spriteBatch);
                textVarious = new TextRenderable("Enemies: " + enemyToSpawn.ToString(), new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2 + 30), spriteFont, Color.Red);
                textVarious.Draw(spriteBatch);
                break;

            case LEVELSTATE.LEVELGAMEOVER:
                textVarious = new TextRenderable("GAME OVER", new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2), spriteFont, Color.Red);
                textVarious.Draw(spriteBatch);
                textVarious = new TextRenderable("Press Q to go to menu.", new Vector2(Game1.SCREEN_WIDTH / 2, (Game1.SCREEN_HEIGHT / 2) + 30), spriteFont, Color.Red);
                textVarious.Draw(spriteBatch);
                break;

            case LEVELSTATE.LEVELFINISH:
                textVarious = new TextRenderable("LEVEL FINISHED", new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2), spriteFont, Color.Red);
                textVarious.Draw(spriteBatch);
                textVarious = new TextRenderable("Press Enter to go to Next Level.", new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2 + 30), spriteFont, Color.Red);
                textVarious.Draw(spriteBatch);
                break;
            }
            textLevel.Draw(spriteBatch);
            spriteBatch.End();
        }
Example #5
0
        public override void Draw(SpriteBatch sb)
        {
            base.Draw(sb);

            listHitbox.Draw(sb);
            if (BaseLevel.showbb)
            {
                listHitbox.drawInfo(sb, Color.Blue, Color.Yellow);
            }
        }
Example #6
0
        public void DrawL1(GameTime gameTime)
        {
            // now the user can actually play the game - this is level 1
            spriteBatch.Begin();
            background.Draw(spriteBatch);
            playerSprite.Draw(spriteBatch);
            yarnBalls.Draw(spriteBatch);

            // draw the bounding box if the user needs it
            if (showBB)
            {
                playerSprite.drawBB(spriteBatch, Color.Red);
            }

            spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            graphicsDevice.Clear(Color.LightCoral);


            //implements a camera
            spriteBatch.Begin(SpriteSortMode.Immediate,
                              BlendState.AlphaBlend, null, null, null, null, cam.get_transformation(graphicsDevice));
            //background here

            platformList.Draw(spriteBatch);
            enemyList.Draw(spriteBatch);
            sliceList.Draw(spriteBatch);
            particleList.Draw(spriteBatch);

            player.Draw(spriteBatch);
            if (showbb)
            {
                //enemyList.drawInfo(spriteBatch, Color.Red, Color.Yellow);
                sliceList.drawInfo(spriteBatch, Color.Red, Color.Yellow);
                player.drawBB(spriteBatch, Color.Red);
                platformList.drawInfo(spriteBatch, Color.Red, Color.Yellow);
                LineBatch.drawLineRectangle(spriteBatch, new Rectangle((int)PlayerSpawnPosition.X, (int)PlayerSpawnPosition.Y, 20, 20), Color.Black);
                LineBatch.drawLineRectangle(spriteBatch, OutOfBounds, Color.Red);
            }



            goal.Draw(spriteBatch);
            spriteBatch.End();


            //DRAW UI STUFF HERE
            spriteBatch.Begin();
            abilityIconDoubleJump.Draw(spriteBatch);
            abilityIconDash.Draw(spriteBatch);
            abilityIconSlice.Draw(spriteBatch);

            TextRenderable score = new TextRenderable("SCORE: " + Game1.TimeScore.ToString(), new Vector2(100, 100), MenuScreen.menuFont, Color.Black);

            score.Draw(spriteBatch);
            //spriteBatch.Draw(texMouseCursor, new Vector2(InputManager.Instance.GetMousePositionX(), InputManager.Instance.GetMousePositionY()), Color.White);
            spriteBatch.Draw(texMouseCursor, null, new Rectangle(InputManager.Instance.GetMousePositionX(), InputManager.Instance.GetMousePositionY(), 30, 30), null, null, 0, null, Color.White, SpriteEffects.FlipHorizontally, 0);
            spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            Vector2 middleScreen = new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2);

            spriteBatch.Begin();

            textRenderable = new TextRenderable(titleString, middleScreen + new Vector2(0, -100), titleFont, Color.White);
            textRenderable.Draw(spriteBatch);
            for (int i = 0; i < menuStrings.Count; i++)
            {
                textRenderable = new TextRenderable(menuStrings[i], middleScreen + new Vector2(0, i * 50), menuFont, Color.White);
                textRenderable.Draw(spriteBatch);
            }

            textRenderable = new TextRenderable("HIGHSCORES", middleScreen + new Vector2(-300, -50), menuFont, Color.White);
            textRenderable.Draw(spriteBatch);
            for (int i = 0; i < 5; i++)
            {
                textRenderable = new TextRenderable((i + 1).ToString() + ".  " + Game1.Scores[i].ToString(), middleScreen + new Vector2(-300, i * 50), menuFont, Color.White);
                textRenderable.Draw(spriteBatch);
            }

            if (unlockChallengeMode == true)
            {
                textRenderable = new TextRenderable("CHALLENGE HIGHSCORES", middleScreen + new Vector2(300, -50), menuFont, Color.Red);
                textRenderable.Draw(spriteBatch);
                for (int i = 0; i < 5; i++)
                {
                    textRenderable = new TextRenderable((i + 1).ToString() + ".  " + Game1.ChallengeScores[i].ToString(), middleScreen + new Vector2(300, i * 50), menuFont, Color.Red);
                    textRenderable.Draw(spriteBatch);
                }
            }

            selector.Position = middleScreen + new Vector2(200, menuSelector * 50 - selector.getWidth() / 2);
            selector.Draw(spriteBatch);

            particleList.Draw(spriteBatch);
            sliceList.Draw(spriteBatch);
            spriteBatch.End();
        }
Example #9
0
        /// <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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            back1.Draw(spriteBatch);  //***
            paddle.Draw(spriteBatch); //***
            ball.Draw(spriteBatch);
            sl.Draw(spriteBatch);

            if (showbb)
            {
                paddle.drawBB(spriteBatch, Color.Black);
                paddle.drawHS(spriteBatch, Color.Green);
                ball.drawInfo(spriteBatch, Color.Gray, Color.Green);
                sl.drawInfo(spriteBatch, Color.Brown, Color.Aqua);
                LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue);
            }
            spriteBatch.End();

            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
Example #10
0
 public void Draw(Graphics g)
 {
     _sprite.SetPosition(120, Direction * Height);
     _sprite.Draw(g, X, Y);
 }
 public void Draw(Graphics g)
 {
     _sprite.Draw(g, X, Y);
 }
Example #12
0
        /// <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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            //All the elements that are displayed on screen are drawn here

            switch (level)
            {
            case 1:
                spriteBatch.Begin(transformMatrix: mainCamera.Transform);
                worldMap.Draw(spriteBatch);
                spriteBatch.DrawString(font, "Current position: " + curPos, new Vector2(horse.getPosX() - 200, horse.getPosY() - 200), Color.White);
                //horse.Draw(spriteBatch);
                horseRun.Draw(spriteBatch);
                spriteBatch.End();
                break;

            default:
                spriteBatch.Begin();
                scrolling1.Draw(spriteBatch);
                scrolling2.Draw(spriteBatch);
                enemies.Draw(spriteBatch);
                horseRun.Draw(spriteBatch);
                bloodSplat.Draw(spriteBatch);
                //arrow.Draw(spriteBatch);
                quiver.Draw(spriteBatch);
                goldBanner.Draw(spriteBatch);
                spriteBatch.DrawString(font, "Gold: " + score, new Vector2(30, 20), Color.Black);
                //This is the start screen that goes away once player presses the enter key
                if (!started)
                {
                    startBanner.Draw(spriteBatch);
                    switch (difficulty)
                    {
                    case 1:
                        spriteBatch.DrawString(difficultySelectText, "Current difficulty: Easy", new Vector2(10, 500), Color.Black);
                        break;

                    case 2:
                        spriteBatch.DrawString(difficultySelectText, "Current difficulty: Medium", new Vector2(10, 500), Color.Black);
                        break;

                    case 3:
                        spriteBatch.DrawString(difficultySelectText, "Current difficulty: Hard", new Vector2(10, 500), Color.Black);
                        break;

                    default:
                        spriteBatch.DrawString(difficultySelectText, "Current difficulty: Easy", new Vector2(10, 500), Color.Black);
                        break;
                    }
                    spriteBatch.DrawString(difficultySelectText, "Click 1, 2 or 3 to assign difficulty. 1 = easy | 2 = medium | 3 = hard" + Environment.NewLine, new Vector2(10, 560), Color.Black);
                }


                //This displays some basic instructions for the player
                if (textFadeTimer < 3 && started)
                {
                    spriteBatch.DrawString(directions, "< : slow down | > : speed up " + Environment.NewLine + "^ : move up | v : move down" + Environment.NewLine + "spacebar : shoot arrow", new Vector2(400, 10), Color.Black);
                }

                //When player dies text and a book appear on screen
                if (gameOver && deathTimer > 1)
                {
                    book.Draw(spriteBatch);
                }

                //Bounding boxes for player, enemies, arrows and the play area
                if (showbb)
                {
                    enemies.drawInfo(spriteBatch, Color.Red, Color.DarkRed);
                    horse.drawBB(spriteBatch, Color.Black);
                    //horse.drawHS(spriteBatch, Color.Green); //don't know if this is required for assessment or not
                    quiver.drawInfo(spriteBatch, Color.Brown, Color.SandyBrown);
                    LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue);
                }
                spriteBatch.End();
                break;
            }
            ;



            base.Draw(gameTime);
        }
Example #13
0
 public override void Draw(GameTime gameTime)
 {
     _switch.Draw(gameTime, new Vector2(Position.X + Font.Width + 5, Position.Y));
     Font.Draw(gameTime);
     base.Draw(gameTime);
 }
Example #14
0
 public void Draw(GameTime gameTime, Color WorldColor)
 {
     animation.Color = WorldColor;
     animation.Draw(gameTime, Position);
 }
        public override void Draw(GameTime gameTime)
        {
            if (score >= 300)
            {
                status = "NEXT LEVEL!";
            }
            else
            {
                status = "Missile Left: " + missileCount;
            }

            graphicsDevice.Clear(Color.Aqua);
            spriteBatch.Begin();

            Dir.background.Draw(spriteBatch);
            player.draw(spriteBatch);

            enemyList.Draw(spriteBatch);
            missileSmoke.Draw(spriteBatch);
            spriteBatch.DrawString(scoreFont, "Score: " + score + "/300", new Vector2(20, 20), Color.Black); // Draw Score on top left
            spriteBatch.DrawString(scoreFont, status, new Vector2(1100, 20), Color.Black);                   // Draw missile count

            if (drawMissile == true && missileCount != 0)
            {
                missile.draw(spriteBatch);
                missile.setPosY(missile.getPosY() - 3);
                missileSmoke.sysPos = new Vector2(missile.getPosX() + missile.getWidth() / 2, missile.getPosY() + missile.getHeight());
            }

            if (collision1 == true)
            {
                drawMissile = false;
                drawExplosion(currXMissile, currYMissile);
                enemy1.setPos(Dir.rnd.Next(-400, -250), Dir.rnd.Next(200, 700));
                if (explostionTimer == 110)
                {
                    collision1      = false;
                    score          += 50;
                    explostionTimer = 0;
                    missileSmoke.deActivate();
                }
            }
            if (collision2 == true)
            {
                drawMissile = false;
                drawExplosion(currXMissile, currYMissile);
                enemy2.setPos(Dir.rnd.Next(-400, -250), Dir.rnd.Next(200, 700));
                if (explostionTimer == 80)
                {
                    score          += 100;
                    collision2      = false;
                    explostionTimer = 0;
                    missileSmoke.deActivate();
                }
            }
            if (collision3 == true)
            {
                drawMissile = false;
                drawExplosion(currXMissile, currYMissile);
                enemy3.setPos(Dir.rnd.Next(-400, -250), Dir.rnd.Next(200, 700));
                if (explostionTimer == 80)
                {
                    score          += 50;
                    collision3      = false;
                    explostionTimer = 0;
                    missileSmoke.deActivate();
                }
            }

            if (showBoundary)
            {
                //LineBatch.drawLineRectangle(spriteBatch, new Rectangle(1, 0, rightBoundary+4, bottomBoundary), Color.Blue);
                player.drawInfo(spriteBatch, Color.Yellow, Color.Red);
                missile.drawInfo(spriteBatch, Color.Black, Color.Red);
                enemyList.drawInfo(spriteBatch, Color.Yellow, Color.Purple);
            }
            spriteBatch.End();
        }