Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void Draw(GameTime gameTime)
- {
- GraphicsDevice.Clear(Color.Green);
- #region SpriteBatch Begin-End
- spriteBatch.Begin();
- if (gameScene.name == "game")
- {
- foreach (var gameObject in bulletObjects)
- {
- gameObject.Draw(spriteBatch);
- }
- foreach (var scenicObject in scenicObjects)
- {
- scenicObject.Draw(spriteBatch);
- }
- foreach (var panzerObject in panzerObjects)
- {
- panzerObject.Draw(spriteBatch);
- }
- }
- foreach (GameObjects.Buttons btn in buttonObjects)
- {
- btn.Update(); // Обновляем состояние кнопки
- if (btn.pressed)
- {
- if (btn.name == "start") // Если мы нажали на кнопку "Начать игру", то можно уже отрисовывать другие объекты
- {
- gameScene.name = "game";
- btn.enabled = false;
- }
- }
- if (btn.enabled)
- {
- btn.Draw(spriteBatch);
- }
- }
- if (gameScene != null && gameScene.name == "game")
- {
- this.IsMouseVisible = false;
- }
- else
- {
- spriteBatch.Draw(blue_cursor.Texture, cursor_coords, Color.White); // Рисуем курсор
- }
- spriteBatch.End();
- base.Draw(gameTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement