How to Create a Room with a View in GameMaker: Studio - dummies

How to Create a Room with a View in GameMaker: Studio

By Michael Rohde

The Room is a part of your game you create in GameMaker: Studio. When you create a Room to work with Views, you should do some planning ahead of time. Here are some questions to consider:

  • How long and wide do you want the Room to be?

  • How long do you want this level of the game to be?

For example, you can have several Rooms in each game, and each Room can represent a level of your game. Therefore, each Room needs to be sized so that it’s big enough (plays long enough) so that you can incorporate each aspect of the level that you want.

Think of it this way: The Room can be a long, skinny column that appears to move down the screen. Only a certain portion of the Room — say, the bottom one-tenth — is seen at any one time. You then place Instances of Objects into the Room. For example, you can place a squadron of enemy planes directly outside the visible portion of the Room, so that they appear shortly after the start of the game.

  1. Right-click Rooms from the Resource tree.

    A submenu appears.

  2. From the submenu, choose Create Room.

    The Room Properties window appears.

  3. Click the Settings tab, shown in this figure.

    The Settings tab.
    The Settings tab.
  4. In the Name field, enter the name you want for the Room.

    For example, you may enter Level_1.

  5. In the Width field, enter 640; in the Height field, enter 4800; and in the Speed field, enter 30.

  6. Click the Backgrounds tab, shown in this figure.

    The Backgrounds tab.
    The Backgrounds tab.
  7. Deselect the Draw Background Color check box.

  8. Select a background image, such as Background 0, from the Scrolling Shooter tutorial.

  9. Select the Tile Hor. and Tile Vert. check boxes.

  10. Click the Objects tab, shown in the next figure.

  11. Select an Object, such as the player’s plane.

  12. Click near the bottom of the Room, for example, where you see the plane.

    An Instance of the Object appears in the Room.

  13. Click the Views tab, shown in the next figure.

  14. Select the Enable the Use of Views check box.

  15. Select the Visible When Room Starts check box.

    The Objects tab.
    The Objects tab.
  16. In the View in Room area, enter 4320 in the Y field.

    You can leave the default settings for X, W, and H.

    These fields indicate the dimensions of the Room that is visible: Y for the top border; X for the left border; W for the right border; and H for the bottom border.

    When you have your View configured, you can see the area of the View as indicated by a thin, white border that appears on the Room grid (refer to the next figure).

  17. Click the green check mark from the icon menu.

    The Room Properties window saves and closes.

If you want to see what you just created, you can run the game now to watch your plane fly up and leave the play area.

The Views tab.
The Views tab.