Sprites are bitmap images used to represent characters, props, and backgrounds in a game. The name of each sprite is important for referencing it in code. Sprites can be resized but larger sprites use more memory. Objects are anything that moves or is animated in the game through events and code. Levels provide a space to test player controls and movement limits can be set through coding boundaries. Scrolling backgrounds use multiple layered images moving at different speeds to create a parallax effect. Particle systems add animated effects like smoke to objects through coded coordinates. Enemies can be given animated sprites and spawn from enemy spawners while being destroyed by collision with player projectiles.
1. Work Flow
Sprites
Sprites are the bitmap images that game maker uses for characters, props and
backgrounds.
The name of your sprite is key as you need to go back and use the sprites again
and again.
The sprite is in pixels and you can change the size of it as you like however as
you make a bigger sprite it will require more memory space from your pc. This
also means if your sprite is of a large size (set by you) there can me more
definition on it meaning you can put more detail on it as you design.
A collision mask also known as a kill box decides whether a character or prop is
affected when it comes in contact. By modifying the sprite’s mask properties
you can choose if the object is able to get hit or come in contact with other
things.
Objects
This is the base of anything that moves (Player(s) ) or is animated. You can add
events to an object to make it do certain things for example by choosing the
step option under event you can give the object a loop of repeating an action.
You can also choose how long the loop is for example if you want the object to
stutter or shake you would make it happen for every frame of the game
instead of a 5 second (Onwards) delay.
Coding
A hint is to help us understand what a code is so you know what the coding
under it is for and means.
2. Codes are used to bind functions to keys for example ‘if keyboard_check
(ord(‘’W’’))’’ means If the W key is pressed, the code above it will come into
action.
You can be more specific on the movement of an object or the player when the
button is pressed by putting in coordinates i.e on the axis.
Levels
The size of a level can be changed to your desire. You can make it as big or
small as you like but like a sprite, the bigger its size the bigger amount of
memory will be used.
You can create a level to use the player and test the controls in. By enabling
the player object for the level I can use the character see if the keys I binded in
the coding function correctly.
Setting movement limits (Walls/Invisible walls)
This requires coding meaning you can limit quite a lot if you desire. For the
player to stay within the level, there needs to be a limit set up around the
level, like walls. You can choose where a player cant go or is stopped by coding
restrictions to the player’s coordinates meaning he/she cannot go any further
than the limit.
To create the wall, you will need to know the exact coordinate of the axis of
the level so you do not end up limiting too much of the area in the level.
Scrolling background
Parallax scrolling is when the background of the game has more than one layer
simultaneously moving/playing.
A background is made in an image editor where you can draw up many layers
of backgrounds for example background1 can be the clouds (made by you)
which moves at a faster rate than background2 which are trees. The maximum
3. number of background layers you can have in Game maker are 8 layers that
will play simultaneously.
Particle system effects
This function can give objects and characters a constantly animated look. For
example by adding particle effects on a barrel I can make smoke come out of
the top of it making it look a bit more logical. To add particles you code
functions onto coordinates of the object and player.
Player Projectile and Sound
Player projectiles are projectiles that emit from the player when the bound key
is pressed. To add this you must add a few events and write some code and
add scripts in the events in order for a visible projectile to come out of the
added points of creation on the axis.
To add sound you simply get a sound file that suits the projectile and add it
from the sound option.
Animated enemy sprite
An animated enemy sprite is a set of images drawn or imported by you which
move in a sequence for example one frame has a circle and a dot inside, for it
to be an animated sprite the circle must move in the next frame so when
played it works in a sequence to give a feel of animation.
Enemy object spawner
This is where and how your enemy objects spawn but not only that, you also
choose how long the spawner takes to reset meaning when a new enemy
spawns from the same spot or whether the spawner only works once for the
level.
Enemy destroyed by lazer
For an enemy to be able to get destroyed by a lazer projectile shot by the
player you must first add the basics i.e collision between the lazer projectile
4. object and enemy object. Then you can go on to code particle effects that emit
from the enemy when contact between the projectile and enemy object is
made.
Enemy projectiles
In order to create projectiles that affect the player, you must create projectiles
that are linked to the enemy object. Rather, inside the enemy object files.
The same procedure applies to enemy projectiles as the player lazer
projectiles.