Creating a GameScreen
Last updated
Last updated
This walk-through creates two screens. The first is a screen called GameScreen which defines what our game has in every level. The second is a screen called Level1 which has files and objects for our first level. GameScreen will be a base class for Level1, and any additional levels will also use GameScreen as a base screen. At the end of this walk-through we will have a tile map rendering in a our game.
The New Project Wizard automatically creates a GameScreen and two Levels if you pick either the Platformer or Top Down project types. This is recommended as the starting point for most projects, and most documentation assumes this setup. Therefore, if you have used the project, you can skip this and move to the next tutorial. If you are interested in how to set this up from scratch, then you can continue reading.
First we'll create a screen called GameScreen. Many FlatRedBall projects contain a GameScreen which typically contains the main gameplay - as opposed to menus to set up the game. The GameScreen also contains any common objects such as lists of entities and game logic. Note that if you have used the Platformer or Top-Down wizard options, you will already have a GameScreen. To add a GameScreen:
In the FRB Editor, select the Quick Actions tab
Click the Add Screen/Level button
Notice that FRB suggests creating a GameScreen. We recommend always having one screen called GameScreen, so this default helps you set your project up quickly.