Esempio n. 1
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     // Create a new SpriteBatch, which can be used to draw textures.
     pixel = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
     pixel.SetData(new[] { Color.White });
     spriteBatch = new SpriteBatch(GraphicsDevice);
     var startAsteroid = new Asteroid(this.graphics.PreferredBackBufferWidth, this.graphics.PreferredBackBufferHeight, this.Content, pixel);
     startAsteroid.Destroyed += new EventHandler((sender, e) =>
     {
         score += (sender as Asteroid).Score;
         //asteroids.Remove((Asteroid)sender);
     });
     asteroids.Add(startAsteroid);
     dino = new Dinosaur(this.graphics.PreferredBackBufferWidth, this.graphics.PreferredBackBufferHeight, this.Content, pixel);
     dino.Killed += new EventHandler(HandleGameOver);
     scoreFont = Content.Load<SpriteFont>("Fonts/scorefont");
     // TODO: use this.Content to load your game content here
 }