This foreword contains these elements:
- An overview of what the tutorial series will be all about;
- A description of the game we’re building during this tutorial series;
- Information about how to set up your development environment.
In this series, we will be helping you build your first game with
engo. We will start from scratch, and work
our way up to a fully-playable game. We will cover topics as:
- The Entity-Component-System paradigm
- Changing scenes within engo
- Writing and using your first custom Shader
- Adding sounds effects and ambiance music to the game
- And probably much more!
The game we will be building, looks a lot like Mini Metro. In that game, cities are popping up which you will have to connect with metro lines. More and more people will want to travel from various cities, making the game harder and harder, until the travelers have to wait too long and it’s game over.
In our game, we won’t be connecting travelers and cities with metro lines. Instead, we’re building highways. This has quite some interesting features:
- As two cities become more and more connected, the welfare (and thus the amount of travelers) increases;
- You may want to add public transportation, i.e. buses, for them to use instead of the car;
- Trucks and vans might slow down the transportation network, as they usually tend to drive at a slower pace;
- Make up your own laws when it comes to taxes (gas, mileage, etc.), but also when it comes to how fast different types of vehicles can drive on various lanes.
- You can connect two highways and get an intersection; there’s no need for this to happen in cities.
One can think of much more interesting features, and we could fill a whole page just listing ideas, but for now, let’s teach you how to set up your own development environment.
For the moment, you can use Windows, Linux and OSX.
sudo apt-get install libasound2-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev xorg-dev libgl1-mesa-dev git-all
- Windows: If you’re running on Windows you’ll need a gcc compiler that the go tool can use and have
gcc.exein your PATH environmental variable. We recommend Mingw since it has been tested.
- OSX: No additional dependencies.
Note that you will only need these installed when you build the game; you will not need these when you want to run the game. You will probably need the ‘runtime’ version of those libraries though (instead of the
-devones), if you want to run the game.
In any case, you will need to install the latest version of Go. Make sure you
correctly set your
$GOROOT (which should point to the installation directory of Go, and your
$GOPATH, which is
basically the root of all your Go projects. Both of these are
$GOPATH directory, you will want to create a directory called
src. What you want to do now, is open
up a terminal / command prompt, go to this location (using the
cd command), and then type in the following Go command:
go get -u engo.io/engo
This tutorial series is built based on engo v1.0, and the master branch possibly contains API changes or other
development changes that may not work exactly as stated in the tutorial. To ensure you’re using v1.0, do
cd $GOPATH/src/engo.io/engo and then checkout the right version with
git checkout v1.0.
This command will fetch
engo from the repository, including all its dependencies.
Now, you will want to create your own project directory for your own game. In Go, it is customary to place the source code
of these projects within code repositories, such as GitHub and Bitbucket. The location of these
repositories is the “import path” of such a Go project. We should create this directory structure within the
folder of the
Our GitHub username is
EngoEngine, and our project is going to be called
TrafficManager. We are hosting the repository on GitHub. This means we want to ensure that this path exists:
Within this directory, we will be creating our game. All our files will be within this directory, and we will be
go-commands (such as
go build and
go run) from this directory (in other words: this directory
is our working directory).