Build a Space Shooter with MonoGame – 2

If Game1.cs is not already open in your code window, you can navigate to it via the Solution Explorer. Once Game1.cs is displayed, add the following to the using statements at the top: using Microsoft.Xna.Framework.Audio; using System.Collections.Generic; using System; We will need the audio part of MonoGame in order to load and play our sounds. We also specify that we want to use “System.Collections.Generic”. We will need this to create lists to hold objects in our game....

May 20, 2019 · 4 min · Jared

Build a Space Shooter with MonoGame – 5

The last two classes we’ll add will be devoted to the scrolling background system. Create a new class, and name it ScrollingBackground.cs. This class does not __need to inherit anything. It will still need the two usual using statements. We will want to add two fields containing background textures and layers: private List<Texture2D> textures = new List<Texture2D>(); private List<ScrollingBackgroundLayer> layers = new List<ScrollingBackgroundLayer>(); The step is to add the constructor. We will be creating a vertical “stack” of three backgrounds, but we’ll be creating two more layers of backgrounds on top....

May 20, 2019 · 4 min · Jared