Tutorial 12. Creating a Start Room for your game

There is a start button in the Asset Resources folder you can use.

start button

But I’d prefer if you created your own! You get marks for originality. You could use https://www.piskelapp.com/ for this.

Create a start button

  1. Create a sprite for your button – call it sprStartButton
  2. Import a button graphic for this and align it to Middle Centre
  3. Next, create a button object – call it objStartButton and associate the sprite above with it
  4. On objButton add the following events and code:

Create Event

image_speed=0;

Mouse Enter event:

//only useful if your button sprite gif has 2 frames

//changes the sprite to the 2nd frame

image_index = 1;

Mouse Leave event:

image_index = 0;

Mouse Left Pressed event:

room_goto(room0); //or whatever your first room is called

Create a Start Room

  1. Duplicate your first room
  2. Rename it to startRoom
  3. Set your startRoom to the home room for your game. You can do this by clicking the organise icon beside your room and drag the startRoom above Room1

A screenshot of a cell phone Description automatically generated

  1. Go into the start room and delete any unnecessary objects from the Instances layer – such as the player object, the enemy spawner etc.
  2. Place the button object you created above into the room
  3. Run your game to test if the start button works

How to Add instructions to your Start Room

  1. Use https://pixelspeechbubble.com/ or https://pixlr.com/x/ to create a set of instructions for you game.
  2. I recommend creating a 500 x 400 for the size of the instructions, with a transparent background.
  3. Then save the image as a PNG and import it as a sprite into GameMaker and make an object out of it to place into your start room.

Add text to the screen

Example if you want to add a copyright notice into the game

  1. Create a Draw-Draw Event on your objStartButton
draw_self();

draw_set_halign(fa_center);

draw_set_valign(fa_middle);

draw_text(x,y+100,"Copyright 2021 T.Brides");

 

Similar Posts

Leave a Reply

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