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(Resources.ColorBg); spriteBatch.Begin(SpriteSortMode.Deferred); buttonMinus.Draw(spriteBatch); buttonPlus.Draw(spriteBatch); buttonMed.Draw(spriteBatch); buttonLow.Draw(spriteBatch); buttonMedium.Draw(spriteBatch); buttonHigh.Draw(spriteBatch); spriteBatch.DrawString(Resources.FontMainTitle, title, new Vector2(xAlign, 15), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0); spriteBatch.DrawString(Resources.FontMain, subtitle, new Vector2(xAlign, 25 + Resources.FontMain.MeasureString(title).Y), Color.White, 0, Vector2.Zero, 0.65f, SpriteEffects.None, 0); spriteBatch.DrawString(Resources.FontMain, "Volume: " + (int)(Resources.volume * 100), new Vector2(xAlign, 185), Color.White, 0, Vector2.Zero, 0.65f, SpriteEffects.None, 0); spriteBatch.DrawString(Resources.FontMain, "Graphics: " + graphics, new Vector2(xAlign, 345), Color.White, 0, Vector2.Zero, 0.65f, SpriteEffects.None, 0); HelperUtils.DrawStringCentered(spriteBatch, new Vector2(Game1.screenSize.X / 2, Game1.screenSize.Y - 50), Resources.FontMain, 0.65f, instructions, Color.White); sTriangle.Draw(spriteBatch); // Draw the cursor Vector2 cursorOffset = new Vector2(Resources.Pointer.Width, Resources.Pointer.Height); spriteBatch.Draw(Resources.Pointer, PlayerInput.mousePosition - (cursorOffset / 2), Color.White); spriteBatch.End(); }
/// <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); }
/// <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); }
public void DrawSS0(GameTime gameTime) { // This draws the splash screen for the computer game spriteBatch.Begin(); kittyCat.Draw(spriteBatch); spriteBatch.DrawString(llFont, "Cat Adventures", titleVec, Color.OrangeRed); spriteBatch.DrawString(mmFont, "It's a hard life being a cat...", sloganVec, Color.OrangeRed); spriteBatch.DrawString(mmFont, "Press S to continue...", instructVec, Color.OrangeRed); spriteBatch.End(); }
public override void Draw(GameTime gameTime) { graphicsDevice.Clear(Color.Aqua); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); Dir.background.Draw(spriteBatch); title.Draw(spriteBatch); pressStart.Draw(spriteBatch); startSub.Draw(spriteBatch); spriteBatch.End(); }
public override void Draw(GameTime gameTime) { graphicsDevice.Clear(Color.BlanchedAlmond); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); scrolling1.Draw(spriteBatch); scrolling2.Draw(spriteBatch); back1.Draw(spriteBatch); //*** paddle.Draw(spriteBatch); //*** ball.draw(spriteBatch); if (p != null) { p.Draw(spriteBatch); } if (showbb) { paddle.drawBB(spriteBatch, Color.Black); paddle.drawHS(spriteBatch, Color.Green); dragonList.drawInfo(spriteBatch, Color.Red, Color.Blue); LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue); ball.drawInfo(spriteBatch, Color.Gray, Color.Green); } if (ball.getPosY() > bot) { //ball.setPosY(60); spriteBatch.DrawString(font1, "Game Over!", new Vector2(100, 100), Color.Green); //dragonList.drawActive(spriteBatch); } //foreach (Sprite3 p in Spritewall) // p.Draw(spriteBatch); if (wl != null) { wl.Draw(spriteBatch, Color.Teal, Color.Red); } LineBatch.drawLineRectangle(spriteBatch, rectangle, Color.Gray); //draw animation //string output1 = "Socre: "; Vector2 FontOrigin1 = font1.MeasureString("a") / 2; spriteBatch.DrawString(font1, "Score " + scoure.ToString(), new Vector2(100, 100), Color.Green); //anmiation1.Draw(spriteBatch); // dragon.Draw(spriteBatch); //if(dragonList != null) dragonList.drawActive(spriteBatch); spriteBatch.End(); }
public void DrawL2(GameTime gameTime) { spriteBatch.Begin(); background.Draw(spriteBatch); crazyDog.Draw(spriteBatch); playerSprite.Draw(spriteBatch); // draw the bounding box if the user needs it if (showBB) { playerSprite.drawBB(spriteBatch, Color.Red); crazyDog.drawBB(spriteBatch, Color.Red); } spriteBatch.End(); }
public override void Draw(SpriteBatch sb) { //int mgStates = 0; // game state // 0=waiting startup // 1=playing // 2=waiting for respawn // 3=Ending count You Win // 4=Ending count You Looser // 5=Game over You Winner // 6=Game over You Looser sb.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); drawBack(sb); if (mgState == 0 || mgState == 1 || mgState == 3) { shooter.Draw(sb); } drawBullets(sb); targets.Draw(sb); if (showbb) { targets.drawInfo(sb, Color.Beige, Color.Gray); shooter.drawInfo(sb, Color.Beige, Color.Gray); } explosions.Draw(sb); eyeCandy.Draw(sb); drawMask(sb); // draw lives for (int i = 0; i < lives; i++) { //lives Rectangle r = new Rectangle((int)(outerRectangle.X + 2 + i * (actualShooterSize.X + 4)), (int)(innerRectangle.Y + innerRectangle.Height + 2), (int)actualShooterSize.X - 2, (int)actualShooterSize.Y - 2); sb.Draw(shooterTex, r, Color.White); } // draw score sb.DrawString(font, mgScore.ToString(), new Vector2(outerRectangle.X + 2, outerRectangle.Y + 1), Color.Black); drawTexts(sb); sb.End(); }
public override void Draw(GameTime gameTime) { graphicsDevice.Clear(Resources.ColorBg); Game1.levelManager.prevStatePlayLevel.Draw(gameTime); spriteBatch.Begin(); if (transparency != null) { transparency.Draw(spriteBatch); } display.Draw(spriteBatch); // Draw Cursor Vector2 cursorOffset = new Vector2(Resources.Pointer.Width, Resources.Pointer.Height); spriteBatch.Draw(Resources.Pointer, PlayerInput.mousePosition - (cursorOffset / 2), Color.White); spriteBatch.End(); }
public override void Draw(GameTime gameTime) { graphicsDevice.Clear(Color.Aqua); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); pauseBackground.Draw(spriteBatch); pause.Draw(spriteBatch); spriteBatch.DrawString(pauseHelpText, "Level 1.", new Vector2(100, 150), Color.White); spriteBatch.DrawString(pauseHelpText, "Shoot enemy ships down. Missile does 10 damage. Aim for 300 Points.", new Vector2(100, 200), Color.White); spriteBatch.DrawString(pauseHelpText, "Pirate Merchant Ships has 10hp and gives you 50 Points.", new Vector2(100, 240), Color.White); spriteBatch.DrawString(pauseHelpText, "Tug Boats has 20hp and gives you 100 Points.", new Vector2(100, 280), Color.White); spriteBatch.DrawString(pauseHelpText, "Level 2.", new Vector2(100, 330), Color.White); spriteBatch.DrawString(pauseHelpText, "Blow UP the Enemy Ships. Missile does 10 damage. Aim for 1000 Points.", new Vector2(100, 370), Color.White); spriteBatch.DrawString(pauseHelpText, "Pirate Merchant Ships has 10hp and gives you 150 Points.", new Vector2(100, 410), Color.White); spriteBatch.DrawString(pauseHelpText, "Tug Boats has 20hp and gives you 200 Points.", new Vector2(100, 450), Color.White); spriteBatch.DrawString(pauseHelpText, "Mines instantly destroy the enemy.", new Vector2(100, 490), Color.White); spriteBatch.DrawString(pauseHelpText, "Press r to return", new Vector2(100, 850), Color.Yellow); spriteBatch.End(); }
/// <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); }
/// <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); }
public override void Draw(GameTime gameTime) { if (score >= 1000) { status = "THE END!"; } else if (player.hitPoints == 0) { status = "YOU DEAD!"; } else { status = "Missile Left: " + missileCount; } spriteBatch.Begin(); backgroundLevel2.Draw(spriteBatch); spriteBatch.DrawString(scoreFont, "Score: " + score + "/1000", new Vector2(20, 20), Color.Black); // Draw Score on top left spriteBatch.DrawString(scoreFont, status, new Vector2(1100, 20), Color.Black); // Draw missile count spriteBatch.Draw(texMouse, new Rectangle((int)mouse_x, (int)mouse_y, 16, 16), Color.White); // draw the mouse here enemy1.Draw(spriteBatch); enemy2.Draw(spriteBatch); player.Draw(spriteBatch); missileSmoke.Draw(spriteBatch); if (timer > 300) { life.setActiveAndVisible(true); life.draw(spriteBatch); } // If certain conditions are met, then draw these weapons 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 (anchorDraw == true) { anchor.setActiveAndVisible(true); anchor.draw(spriteBatch); anchor.setPosY(anchor.getPosY() + 4); } if (drawMines && mineCount == 1) { mine.setPos(minePos.X, minePos.Y); mine.draw(spriteBatch); } // If there is a collision, draw explosion animation if (collision1 == true) { drawMissile = false; drawExplosion(currXMissile, currYMissile); enemy1.setPos(Dir.rnd.Next(-400, -250), Dir.rnd.Next(200, 700)); if (explostionTimer == 100) { collision1 = false; score += 50; explostionTimer = 0; } } 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 (mineCollisionToggle == true) { mineCollission = false; mineExplostionAnimation.setPos(mineCurrPos.X - mine.getWidth() / 2, mineCurrPos.Y - mine.getHeight() / 2); mineExplostionAnimation.draw(spriteBatch); if (explostionTimer == 100) { mineExplostionAnimation.makeInactive = true; enemy1.setPos(Dir.rnd.Next(-400, -250), Dir.rnd.Next(200, 700)); mineCollisionToggle = false; explostionTimer = 0; } } if (mineCollisionToggle2 == true) { mineCollission2 = false; mineExplostionAnimation.setPos(mineCurrPos.X - mine.getWidth() / 2, mineCurrPos.Y - mine.getHeight() / 2); mineExplostionAnimation.draw(spriteBatch); if (explostionTimer == 100) { mineExplostionAnimation.makeInactive = true; enemy2.setPos(Dir.rnd.Next(-400, -250), Dir.rnd.Next(200, 700)); mineCollisionToggle2 = false; explostionTimer = 0; } } // Draw BB if (showBB) { player.drawInfo(spriteBatch, Color.White, Color.Yellow); enemy1.drawInfo(spriteBatch, Color.White, Color.Yellow); enemy2.drawInfo(spriteBatch, Color.White, Color.Yellow);; missile.drawInfo(spriteBatch, Color.White, Color.Yellow); life.drawInfo(spriteBatch, Color.White, Color.Yellow); mine.drawInfo(spriteBatch, Color.White, Color.Yellow); anchor.drawInfo(spriteBatch, Color.White, Color.Yellow); //weaponList.drawInfo(spriteBatch, Color.White, Color.Yellow); } spriteBatch.End(); }