This tutorial will introduce the FlatRedBall engine, and Glue – a program which helps with the creation and organization of game projects. We’ll be exploring Glue’s features by creating a game called Beefball – a multiplayer competitive game similar to air hockey.
When finished our game will have two circles, each movable with either the keyboard or an Xbox controller, and a smaller circle which each player can use to earn points.
The first step in any game project is to open up Glue. If you’ve downloaded and unzipped the FRBDK.zip file, then you should already have Glue on your machine. Unzip the file, open the Xna 4 Tools folder, and run GlueFormsCore.exe.
If you haven’t yet downloaded the FRBDK.zip file, you can get it from the Download page.
Creating a new project
Once you open Glue, you can create a new project. To create a new Project:
- Select File->New Project
- The New Project Creator should open. Select the Empty Projects category.
- Select Desktop GL as the platform. Our game will target this platform because it is easy to debug. Creating the project for a desktop platform is recommended even if the game is intended to run on non-desktop platforms (such as Android). Additional platforms can be added at any time.
- Enter Beefball for the Project Name.
- (Optional) Change the location of the project. By default the project will be created in Documents\FlatRedBallProjects.
- Click the Make my project! button to create the project.
The latest FlatRedBall template will be downloaded, so your project will be running against the newest version available.
Now that you’ve made a project, Glue will remember this as your last-opened project and automatically open it for you next time you open Glue.
Glue and Visual Studio
Glue is a tool meant to work hand-in-hand with Visual Studio. It is not a replacement for Visual Studio, meaning you will be doing work in both Visual Studio and Glue. It is quite common to develop FlatRedBall games with both Visual Studio and Glue open at the same time.
Opening and Running your project
When creating a Glue project, an accompanying Visual Studio project is also created. To open the project, click the Visual Studio icon in Glue, as show in the following image:
You can also open the project by opening the .sln file. You can navigate to the location of the .sln file and double-click it, or open it through Visual Studio. The .sln is located one folder above the .glux file, which is the title of the Glue window. For example, the solution for the project as shown in the screenshot would be:
You may see a window like this:
If so you will want to select the version of Visual Studio that is compatible with the type of project you are running. At the time of this writing, Visual Studio 2019 is the most common version to use with FlatRedBall.
Once Visual Studio is open, you can run your project by pressing the green “play” button, or by pressing F5
Your game should run if all prerequisites have been properly installed. You should see a blank game
That was easy! So far you have a fully-functional game using FlatRedBall. The next tutorial will cover making our first Entity.