public void Draw() { SpriteRender.ResetView(800, 600); SpriteRender.DrawRect(10, 10, 0.0f, healthBarWidth, 15, Color4.DarkRed); SpriteRender.DrawRect(10, 10, 0.0f, (health / 100) * healthBarWidth, 15, Color4.Red); if (score != 0) { TextRender.Draw(350f, 10f, 0.0f, score.ToString(), Fonts.Standard, Color4.White, 2f); } TextRender.Draw(500f, 10f, 0.0f, lives + "", Fonts.Standard, Color4.Yellow, 2f); TextRender.Draw(550f, 10f, 0.0f, tokens + "", Fonts.Standard, Color4.Yellow, 2f); if ((int)(inventory & InventoryItem.Key1) > 0) { SpriteRender.Draw(170, 5, 0, 20, 20, Textures.Key); } if ((int)(inventory & InventoryItem.Key2) > 0) { SpriteRender.Draw(200, 5, 0, 20, 20, Textures.Key); } if ((int)(inventory & InventoryItem.Key3) > 0) { SpriteRender.Draw(230, 5, 0, 20, 20, Textures.Key); } if ((int)(inventory & InventoryItem.Key4) > 0) { SpriteRender.Draw(260, 5, 0, 20, 20, Textures.Key); } }
public void DrawDead() { var totalTime = endTime.Subtract(startTime); SpriteRender.ResetView(800, 600); TextRender.Draw(100f, 100f, 0f, "GAME OVER", Fonts.Standard, Color4.Red, 5f); TextRender.Draw(100f, 460f, 0f, "TIME: " + (int)totalTime.TotalMinutes + ":" + totalTime.Seconds.ToString("00"), Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 480f, 0f, "SCORE: " + lastscore, Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 500f, 0f, "HIGHSCORE: " + highscore, Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 520f, 0f, "PRESS ENTER TO PLAY AGAIN", Fonts.Standard, Color4.White, 2f); }
public void DrawEnd() { var totalTime = endTime.Subtract(startTime); SpriteRender.ResetView(800, 600); TextRender.Draw(100f, 100f, 0f, "CONGRATULATIONS", Fonts.Standard, Color4.Green, 5f); TextRender.Draw(100f, 150f, 0f, "", Fonts.Standard, Color4.White, 1.75f); TextRender.Draw(100f, 440f, 0f, "TIME: " + (int)totalTime.TotalMinutes + ":" + totalTime.Seconds.ToString("00"), Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 460f, 0f, "TOKENS: " + savedTokens, Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 480f, 0f, "SCORE: " + savedScore, Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 500f, 0f, "HIGHSCORE: " + highscore, Fonts.Standard, Color4.White, 2f); TextRender.Draw(100f, 520f, 0f, "PRESS ENTER TO PLAY AGAIN", Fonts.Standard, Color4.White, 2f); }
public override void Draw(TimeSpan delta) { SpriteRender.Begin(); SpriteRender.ResetView(800, 600); //SpriteRender.Draw(pX, pY, 0, 8, 8, texture, Color4.Red); //SpriteRender.Draw(x, y, 0, 32, 32, texture, Color4.Yellow, rotation: r); for (int i = 0, n = _sprites.Count(); i != n; ++i) { _sprites[i].Draw(); } //gameplay.Draw(delta); }