The Arcade Shooter is currently split into the four projects described below:
Project | Description | Namespace API |
---|---|---|
Katana Engine | Katana Engine is a library of classes, interfaces, and value types that provides a foundation for developing two-dimensional games in C++. | Katana Engine API |
Shooter Library | Shooter Library is a library of classes, interfaces, and value types that provides a foundation for developing shoot 'em up style games. | Shooter Library API |
Guardian Final Zero | Guardian FZ it the main game that will be playable at launch. Note: Guardian FZ is not included in the documentation. |
N/A |
Sample | Sample is a sample game to use as a template for creating your own games utilizing the Katana Engine and Shooter Library. | Sample API |
To get started, fork this project to your Github account. Then setup your own project by following the steps below.
Create your Game Project (Click to Expand):
- Open up the Arcade Shooter solution in Visual Studio.
- In the Solution Explorer you will see two folders; Games and Libraries.
- Right-click on the Games folder, and select Add > New Project...
- Select Visual C++ (on the left) and select the Empty Project type.
- Next, enter the name of your game, and click OK.
You now have your own project! But, there's still some setup to do... Katana Engine is built upon a graphics library called Allegro. Luckily, there is a NuGet package for it, so installation is pretty simple:
Install and Setup Allegro (Click to Expand):
- In the Solution Explorer, right-click on your project, and select Manage NuGet Packages.
- Click Browse, and search for "allegro".
- Select the latest Allegro 5 package.
- Make sure that the Latest Stable version is selected, and click install. You may have a "Review Changes" box pop-up. Just click OK.
- Right-click on your project again (in the Solution Explorer), and select properties.
- Expand Allegro 5 (on the left) and select Add-ons, and then change all the Addon values to "Yes."
- Click OK.
Okay, Allegro is all ready to go! Now, let's write a little code:
Create an entry point, and link to Katana Engine and Shooter Library (Click to Expand):
- Within your project, locate the Source Files folder.
- Right-click on it, and select Add > New Item...
- Name the file Main.cpp, and click Add.
- Then type (or copy/paste) the following line:
int main() { return 0; }
- Now, let's build the solution. There are a number of ways to do this. I find Ctrl + Shift + B to be the quickest.
- After building, we will now have an additional section in the project settings (Right-click on your project and select properties).
- Notice, the C/C++ area? Click on General, and next to Additional Include Directories add the following:
..\ShooterLibrary;..\KatanaEngine;
- Click OK.
- Next, we need to add a couple of project references. Right-click on your project and select Add > Reference...
- Check the checkboxes next to Katana Engine and Shooter Library.
- Click OK.
Now you can incorporate all of the code from both of those projects! Last step in this tutorial:
Create and Run your Game class: (Click to Expand):
- Add another item to your project (Right-click, Add > New Item...).
- This time it needs to be a header file.
- Click Add.
- Copy and paste the following code:
#pragma once
#include "ShooterLibrary.h" // Include the shooter library code!
class MyGame : public ShooterLibrary::Game // "MyGame" inherits from the Shooter Game
{
public:
virtual ~MyGame() { }
virtual std::string GetName() const { return "My Game!!!"; }
};
- Switch over to Main.cpp and change the code to:
#include "MyGame.h"
int main() { return (new MyGame())->Run(); }
- To run your game, you'll need to set it as the "Startup Project." This can be found under the Project Menu (Project > Set as Startup Project).
- Press F5 to Build and Run!
Okay, I admit it. It's not too exciting. However, your game is running, and (as proof) you can see the name in the title bar.
More tutorials to come! In the mean time, look at the Sample game code (found in the solution), and the documentation (found below).
Documentation is generated using Doxygen.