Пример #1
0
 public void NewGame()
 {
     Score = 0;
     TimeSinceLastScoreUpdate = 0;
     Level            = 0;
     TimeSpent        = 0;
     player.Rectangle = new Rectangle(50, 100, 88, 73);
     GameOver         = false;
     ObstacleManager  = new ObstacleManager(this);
 }
Пример #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);


            bg = new Background(this, Content.Load <Texture2D>("background"),
                                new Rectangle(0, 0, 800, 480));

            player = new Player(new List <Texture2D>()
            {
                Content.Load <Texture2D>("planeRed1"), Content.Load <Texture2D>("planeRed2"), Content.Load <Texture2D>("planeRed3")
            },
                                new Rectangle(50, 100, 88, 73));

            Explosion = new Explosion(this);

            Font  = Content.Load <SpriteFont>("Fonty");
            Music = Content.Load <Song>("audio");
            MediaPlayer.Play(Music);
            MediaPlayer.IsRepeating = true;

            ObstacleManager = new ObstacleManager(this);
        }