Now that we've gotten a good understanding of why we would want to use design patterns, let's get set up the game engine that we will be using over the course of the book: the Mach5 engine. Now in order to get started, we will need to download the engine as well as the software needed to run the project. Perform the following steps:
- Open up your web browser of choice and visit the following website:Â https://beta.visualstudio.com/downloads/. Once there, move to the Visual Studio Community version on the left and then click on the Free download option, as shown in the following screenshot:
- If you get a window asking what to do with the file, go ahead and open it or save and then open it by clicking on the Run button:
- From there, wait until the installer pops up, then select Custom, and then click on Next to start downloading the program:
- Now once you get to the Features section, uncheck whatever is selected and then open up the Programming Languages tab and check Visual C++. You may go ahead and remove the other options, as we will not be using them. Then go ahead and click on the Next button, then Install, and allow it to make changes to your computer:
You may need to wait a while at this point, so go ahead and get yourself a coffee, and once it's finished you'll need to restart your computer. After that, go ahead and continue with the project.
- Once you've finished installing, you next need to actually install the engine itself. With that in mind, go over to https://github.com/mattCasanova/Mach5 and from there, click on the Clone or download section and then click on Download ZIP:
- Once you're finished with the download, go ahead and unzip the file to a folder of your choice; then open up the Mach5-master\EngineTest folder, double-click on the EngineTest.sln file, and start up Visual Studio.
- You may get a login screen asking you to log in; go ahead and sign up or press the Not now, maybe later option on the bottom of the screen. You can then pick a color theme; then click Start Visual Studio.
- Upon starting, you may get a security warning asking if you'd still like to open this project. This is displayed from any Visual Studio solution that wasn't made on your machine, so it wants to make sure that you know where it came from, but in this case the project is perfectly safe. Go ahead and uncheck the Ask me for every project in this solution option and then select OK:
- Once it's finished loading, you should finally see the Visual Studio interface, which should look like this:
Visual Studio is a very powerful tool and, for developers, it can be quite useful to learn all of the functionality that it has. We'll be discussing the features as we use them, but this book shouldn't be considered the end-all book on Visual Studio.
- The engine is built to work on 32-bit processors, so change the x64 dropdown to x86 and then click the Play button or press F5. It will then ask if you wish to rebuild the project. Go ahead and say Yes. If all goes well, you should eventually see a debug window and a gameplay window as well. After a few seconds, it should transition to a simple default project:
You can play around by using the W, A, and D keys to move the character around and the Spacebar to shoot bullets at enemies. Once you're finished playing around, go ahead and hit the Esc key to go to the menu, and then click on the Quit button to leave the project and go back to the editor!