Example #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.
     spriteBatch = new SpriteBatch(GraphicsDevice);
     //Textures
     rocket     = this.Content.Load <Texture2D>("Textures\\rocket");
     control    = this.Content.Load <Texture2D>("Textures\\control");
     background = this.Content.Load <Texture2D>("Textures\\background");
     projectile = this.Content.Load <Texture2D>("Textures\\missle");
     rock       = this.Content.Load <Texture2D>("Textures\\meteor");
     //Fonts
     kootenayFont = Content.Load <SpriteFont>("Fonts\\Kootenay");
     //Sounds
     backgroundMusic = Content.Load <Song>(@"Audio\background");
     winSound        = Content.Load <Song>(@"Audio\excellent");
     loseSound       = Content.Load <Song>(@"Audio\gameover");
     //player
     player = new playerShip(rocket);
     //enemies
     for (int i = 0; i < 5; i++)
     {
         enemies[i] = new enemy(rock, i * 10, i * 10);
     }
     // TODO: use this.Content to load your game content here
 }
Example #2
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.
     spriteBatch = new SpriteBatch(GraphicsDevice);
     //Textures
     rocket = this.Content.Load<Texture2D>("Textures\\rocket");
     control = this.Content.Load<Texture2D>("Textures\\control");
     background = this.Content.Load<Texture2D>("Textures\\background");
     projectile = this.Content.Load<Texture2D>("Textures\\missle");
     rock = this.Content.Load<Texture2D>("Textures\\meteor");
     //Fonts
     kootenayFont = Content.Load<SpriteFont>("Fonts\\Kootenay");
     //Sounds
     backgroundMusic = Content.Load<Song>(@"Audio\background");
     winSound = Content.Load<Song>(@"Audio\excellent");
     loseSound = Content.Load<Song>(@"Audio\gameover");
     //player
     player = new playerShip(rocket);
     //enemies
     for (int i = 0; i < 5; i++)
     {
         enemies[i] = new enemy(rock, i * 10, i * 10);
     }
     // TODO: use this.Content to load your game content here
 }