Your first game! Part 1: Moving AroundPosted on: March 1, 2015 at 5:42 pm,
Part 1 | Part 2 | Part 3 | Part 4
Assuming you now understand the very basics by which GameMaker: Studio operates (and if you don’t I highly recommend reading my article on said basics) we can now dive in and start actually using the software to build something playable! This tutorial series aims to recreate the classic game “Asteroids” using GameMaker: Studio and some basic scripting. No knowledge of code is assumed.
So create a new project, and lets get started!
The Game Room
The first thing that we need to make anything in GameMaker is a room. Your game cannot run without at least one room, so go ahead and right click on rooms in your resource tree to create a new one!
On creating a new room you’ll be shown a big empty grey room and a bunch of menus on the left in different tabs. The settings tab will be open by default, use it to give your room a name (I use “rm_game”) and set its speed to 60. One habit to very quickly learn when using GameMaker is to give your resources appropriate names. The easiest way to do this is to name your resources based on what type of resource they are (rm = room, obj = object, spr = sprite and so on) followed by an underscore and then just something that identifies what that resource is. This is the room where our game takes place, so I called it rm_game. If I wanted to make a menu screen, I would call that room rm_menu for example.
Setting the room speed to 60 changes your game’s target framerate from 30 fps (frames per second) to 60 fps A framerate of 60 fps is generally desireable for the majority of 2d games, especially action games. This will generally make your game feel smoother and faster than it would at 30 fps.
The only other thing we need to do in our room for now is change this ugly grey background to something more fitting for asteroids. Let’s make it black to resemble the classic. In the various menu tabs for your room where you see “settings” “objects” etc, select “backgrounds”. Make sure that “Draw Background Colour” remains ticked and click in the colour box and change the background colour to black. (forgive my UK spelling of “Colour” if you happen to be American, my hands just won’t let me type it the other way!)
We can actually run our game at this point but we wouldn’t see anything but a big black rectangle. Not very exciting. So lets get to work on our player!