The Box2D Blank Game
Game Physics with a 2D Physics Engine
Loading...
Searching...
No Matches

1. Introduction

This is pretty much what it says, a blank 2D game with Box2D and a contact listener for sounds. Its purpose is to get you started quickly on the basics of making a 2D game with Box2D. You can also use it to start development of a new game.

The remainder of this page is divided into five sections. Section 2 lists the controls and their corresponding actions, Section 3 tells you how to build it, Section 4 gives you a list of actions to take in the game to see some of its important features, Section 5 gives a breakdown of the code, and Section 6 addresses the question "what next?".

2. Keyboard Controls

Key
Action
F1
Help (this document)
F2
Toggle draw mode from "sprites only", to "sprites and lines", to "lines only"
P
Save screenshot to a file
Esc
Quit game and close the window

3. Building the Game

This code uses SAGE and Box2D. Make sure that you have followed the SAGE Installation Instructions and the Box2D Installation Instructions. Navigate to the folder 11. Box2D Blank Game in your copy of the sage-physics repository. Run checkenv.bat to verify that you have set the environment variables correctly. Open Box2D Blank Game.sln with Visual Studio and build the Release configuration. Alternatively, run Build.bat to build both Release and Debug configurations.

4. Game Play

There is none yet. This is up to you.

5. Code Breakdown

Add your code to this project.

6. What Next?

Next, take a look at the Stroop Test Game.