1. Setting up GameMaker
Basic configuration
To start, this game will be written in GameMaker Language using the GameMaker 2 IDE. Before developing the game, I'll just cover the basic configurations for the development of the game. These will effect how the game appears and runs for the player in the final version.
60 frames / sec (60fps)
Game resolution: 500 x 500
Starting point
To start creating the game, we begin at the building blocks of the game. That is, our player models and the interactions with the world around. As such, we typically always begin in the following pattern:
Create player sprite
Create player object using sprite
Define player actions through events
Definitions
However, what do these things mean? What are sprites, objects, actions and events?
Sprites
Sprites are essentially the images shown in the game. These are the visuals, the front-end, the aesthetics of the game are created using sprites. So how your player looks, the backgrounds, the tiles in your game are defined by the sprites for the game.
By convention, we typically prefix our items by the type because we aren't able to have duplicate name conflicts in GameMaker. For example, you can't name a sprite 'cat
' and then try to name an object 'cat
' - it's generally best practice to do something like spr_cat
and obj_cat
for semantic purposes.
Objects
Objects are where the magic happens. To understand what objects are in GameMaker, you can simply look at objects in real life. If you think of a cat as a generic object, we can associate certain properties to cats that are unique about it. Furthermore, we also have different unique behaviours that we attribute to cats.
Properties (cat)
Behaviours (cat)
Has a tail
Purr
Has 4 legs
Meow
Is a feline
Eat
Has good balance
Sleep
So these are exactly what objects are in programming. When we create an object, we simply define the properties and behaviours of that object. For example, if we represent a ball and name it obj_ball
we have:
The behaviours of the objects are thereby dictated by EVENTS which give rise to an ACTION.
Events and Actions
With programming logic, we can simply boil it down to the statement:
if
thisthen
that
So in GameMaker, we have events as the triggers for certain actions to happen. The behaviour of the object is thereby defined by the actions of the object. For example, if we make the ball bounce (action) every time it hits a surface (event), we obtain the behaviour that obj_ball
bounces!
Rooms
Rooms are like the levels or screens within your game world. How the title, credits, end screen and where the gameplay happens all is defined inside of rooms. Within these rooms are the objects of the game as well as the background for the room. By default, GameMaker will automatically have a Background Layer for the room (to have scenery that players don't interact with) and an Instances Layer (where objects like walls, player models, enemies, etc are placed).
Placing objects in the Instances Layer is actually quite intuitive. If you think back to objects, they are quite simply the generic templates or categories i.e. cat
and ball
. However, in the real world we have unique instances of cats and balls such as siamese cats, basketballs, persian cats and tennis balls. These instances of objects have the same underlying behaviour as well as their own unique attributes and behaviours!
Last updated
Was this helpful?