Tutorial 4: Creating a Game Room in GameMaker Studio 2

Change the Room size

In the Assets Browser menu, double click the room  that you want to add a background to. The default room is Room1

If you don’t see the Layers panel for the room appear on the left side of GameMaker, go to the top menu, click Room – Layer View & Room Properties.

For our simple game, we want to change the room size to be 960 pixels wide by 640 pixels high.

This is in the Properties section of the Room Editor panel.

Change the Width to 960 and the Height to 640.

gamemaker room size properties
Room size

Setup the room background

In order to have a background image for you room, you’ll need two background layers, one for the rooms background colour and another for the rooms background image. Ensure that you setup the background layers like this. If you just try to create a room with a background image only, it will cause problems in your game later when you add movement to background image.

  1. Rename default Background to BackgroundColour
  2. Click on the black bar beside Colour
  3. In the Hex box type 5e3f6b this will give you a purple colour
  4. Create a new Sprite in the Assets Browser. Name it bgRoom1 and import this transparent stars background file.
    It can also be found inside the zipped resources for this game  spaceshooter-assets/backgrounds folder
  5. From the Assets Browser, double click back into the room in the room editor find the icon to Create a New Background Layer
    gamemaker room background layer
  6. In this new background layers properties, click on No Sprite and choose the sprite you just created in Sprites for the background.
  7. Under the Colour option in the background layer properties check two boxes, Horizontal Tile and Vertical Tile. This will create a star effect background.
  8. Scroll down into this new background layers properties you can make the background animate. If you are developing a top-down shooter, enter 0.5 into Vertical Speed

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *