public void Draw(GameTime gameTime) { MusicPlayer mp = this._mainGame.GameManager.GetComponent <MusicPlayer>(); ResourcesComponent rc = this._mainGame.GameManager.GetComponent <ResourcesComponent>(); this._mainGame.MainSpriteBatch.Draw(rc.PlayerTexture, new Rectangle(this._mainGame.MainViewport.Width / 2 + 2, this._mainGame.MainViewport.Height / 2, 50, 50), Color.White * mp.AvarageFrequency * 1.9f); this._mainGame.MainSpriteBatch.Draw(this.Circle, new Vector2(this._mainGame.MainViewport.Width / 2 - this.Shield, this._mainGame.MainViewport.Height / 2 - this.Shield), Color.DarkMagenta * mp.AvarageFrequency); }
public void Draw(GameTime gameTime) { if (this.StatusShowTime > 0) { ResourcesComponent rc = this._mainGame.GameManager.GetComponent <ResourcesComponent>(); this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, this.Status, new Vector2(this._mainGame.MainViewport.Width / 2 - this._mainGame.MainViewport.Width * 0.04f, 0), this._statusColor); } }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public void Draw(GameTime gameTime) { MusicPlayer mp = this._mainGame.GameManager.GetComponent <MusicPlayer>(); ParticleSystems ps = this._mainGame.GameManager.GetComponent <ParticleSystems>(); Player p = this._mainGame.GameManager.GetComponent <Player>(); ResourcesComponent rc = this._mainGame.GameManager.GetComponent <ResourcesComponent>(); this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Score: " + this._actualSongScore, new Vector2(2, 2), Color.Magenta * mp.AvarageFrequency * 1.6f); this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Score: " + this._actualSongScore, new Vector2(0, 0), Color.White); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Multiply: " + p.Multiplier + "x", new Vector2(0, 35), Color.White); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Time: " + this._musicTimeText, new Vector2(this._mainGame.MainViewport.Width - 150, 15), Color.White); this._mainGame.MainSpriteBatch.DrawString(rc.SmallerFont, "[esc]to menu", new Vector2(this._mainGame.MainViewport.Width - 150, 2), Color.White); if (this._actualSongHightScore > 0) { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "High score: " + this._actualSongHightScore, new Vector2(0, 55), Color.White); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, ", " + this._actualSongStatus, new Vector2(200, 55), Color.Purple); } else { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "High score: First time playing", new Vector2(0, 55), Color.White); } this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Shield: " + p.Shield + "%", new Vector2(0, 75), Color.White); if ((ps.BonusPower >= 0) && (ps.BonusPower < 25)) { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Bonus Lux", new Vector2(0, 175), Color.Red); } else if ((ps.BonusPower >= 25) && (ps.BonusPower < 50)) { this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 160), Color.Red); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Bonus Lux", new Vector2(0, 175), Color.Red); } else if ((ps.BonusPower >= 50) && (ps.BonusPower < 75)) { this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 145), Color.Red); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 160), Color.Red); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Bonus Lux", new Vector2(0, 175), Color.Red); } else if ((ps.BonusPower >= 75) && (ps.BonusPower < 100)) { this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 130), Color.Orange); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 145), Color.Orange); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 160), Color.Orange); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Bonus Lux", new Vector2(0, 175), Color.Orange); } else if (ps.BonusPower >= 100) { this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 115), Color.Green); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 130), Color.Green); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 145), Color.Green); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Vector2(10, 160), Color.Green); this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Bonus Lux", new Vector2(0, 175), Color.Green); } if (this._timeToBonus > 0) { if (this._timeToBonus > 9) { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "bonus shield: 0:" + this._timeToBonus, new Vector2(0, 195), Color.Red); } else { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "bonus shield: 0:0" + this._timeToBonus, new Vector2(0, 195), Color.Red); } } else { if ((this._timeToBonus == 0) && (!ps.BonusFieldActive)) { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "bonus shield: 0:00", new Vector2(0, 195), Color.Green); } if (ps.BonusFieldActive) { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "bonus shield: 0:0" + this._bonusTime, new Vector2(0, 195), Color.Purple); } } }
public void Draw(GameTime gameTime) { if (this._mainGame.IsPaused && this._mainGame.IsActive) { ResourcesComponent rc = this._mainGame.GameManager.GetComponent <ResourcesComponent>(); MusicPlayer mp = this._mainGame.GameManager.GetComponent <MusicPlayer>(); IEnumerable <Track> tracks = mp.SongArchive.GetTopTen(); this._mainGame.MainSpriteBatch.Draw(rc.MenuBackground, new Rectangle(this.GetMenuX(), this._nowPositionY, this._nowWidth, this._nowHeight), this._menuBackgroundColor); if (this._nowHeight == this._height && this._nowPositionY <= this._positionY) { if (mp.SongLibrary != null && mp.SongLibrary.Count > 0) { if ((!this._topTenCheck) && (!this._randomNineCheck)) { if (this._menuItems != null && this._menuItems.Count > 0) { foreach (KeyValuePair <Int32, String> mi in this._menuItems) { if (this._selectedItem == mi.Key) { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, mi.Value, new Vector2(this.GetMenuX() + 145, this._nowPositionY + 60 + 40 * mi.Key), Color.Red); } else { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, mi.Value, new Vector2(this.GetMenuX() + 145, this._nowPositionY + 60 + 40 * mi.Key), Color.Black); } //i++; } } //this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "now playing: " + title, new Vector2(this._mainGame.MainViewport.Width / 2 - Width / 2, this._mainGame.MainViewport.Height / 2 + Height / 2 - 50), Color.Purple); } else { if (this._topTenCheck) { Int32 trackIterator = 0; if (tracks != null && tracks.Any()) { foreach (Track t in tracks) { try { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, TextUtils.RemoveDiacritics(t.ToString()), new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 40 * trackIterator), Color.Black); trackIterator++; } catch (ArgumentException) { trackIterator++; } } } if (this._selectedItem == 0) { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Back", new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 41 * 9), Color.Red); } else { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Back", new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 41 * 9), Color.Black); } } else { if (this._randomNineCheck) { if (this._randomNineSongs != null && this._randomNineSongs.Count > 0) { foreach (Int32 s in this._randomNineSongs) { try { Int32 indexOfSong = this._randomNineSongs.IndexOf(s); String songName = TextUtils.GetSongName(mp.SongLibrary[s]); songName = (String.IsNullOrEmpty(songName) || songName.Length <= Track.MAX_FULL_TEXT_LENGTH) ? songName : songName.Substring(0, Track.MAX_FULL_TEXT_LENGTH) + Track.DOTS; songName = TextUtils.RemoveDiacritics(songName); if (this._selectedItem == indexOfSong) { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, songName, new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 40 * indexOfSong), Color.Red); } else { this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, songName, new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 40 * indexOfSong), Color.Black); } } catch { //nothing //this._mainGame.MainSpriteBatch.DrawString(rc.ScoreFont, "Wrong character", new Vector2(this._mainGame.MainViewport.Width / 3f, this._mainGame.MainViewport.Height / 2 - this._height / 2 + 60 + 40 * indexOfSong), Color.Black); } } } if (this._selectedItem == 9) { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Back", new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 40 * 9), Color.Red); } else { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Back", new Vector2(this.GetMenuX() + 15, this._nowPositionY + 60 + 40 * 9), Color.Black); } if (this._selectedItem == 10) { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Next list", new Vector2(this.GetMenuX() + this._nowWidth - 165, this._nowPositionY + 60 + 40 * 9), Color.Red); } else { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Next list", new Vector2(this.GetMenuX() + this._nowWidth - 165, this._nowPositionY + 60 + 40 * 9), Color.Black); } } } } } else { this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "Please insert some songs", new Vector2(this.GetMenuX() + 20, this._nowPositionY + 80), Color.Yellow); this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "into MS MediaPlayer", new Vector2(this.GetMenuX() + 120, this._nowPositionY + 180), Color.Yellow); } this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "sound collector", new Vector2(this.GetMenuX() + 118, this._nowPositionY + 12), Color.Black); this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "sound collector", new Vector2(this.GetMenuX() + 115, this._nowPositionY + 10), Color.MediumSlateBlue); this._mainGame.MainSpriteBatch.DrawString(rc.BiggerFont, "runs on dpsf particle engine", new Vector2(this.GetMenuX(), this._nowPositionY + this._height - 41), Color.Peru); } } }