Week 1: Let's Make A Game
In week 1 we'll look at a few games and make our own "breakout" game. We'll
also talk about all the things that go into a game and you'll be ready to
design your own game! Your assignment will be to bring a game idea to the next class.
Week 2: What's In A Game?
In week 2 you'll present your game ideas to the group and we'll discuss what makes
a good game. Then we'll spend some hands-on time examining all of the things the
Gamemaker tool can do for you. You'll start writing your game this week! Your
assignment will be to "detail" your game idea. If your game idea was "a frog hops
across a road and tries to not get hit by a truck", your detail may include how
many trucks go by and how fast and how wide the road is and how scoring will work
and how many lives you get and what the next level will look like and...
Week 3: Putting It All Together
We'll review Gamemaker and all the things that make a game: objects, events, properties,
sprites, rooms, and so on, and by the start of week 3 you'll know what all those things mean!
We'll talk about what to do when things go wrong, but mostly you'll be building your game!
Now that you've seen what the real world of Gamemaker is like, your assignment will be to
revise the detail you came in with. You may decide that you want trucks to come from both
directions, and there should be a manhole to fall down and having a pickup truck try to run
down the frog is Just Too Hard!
Week 4: Peer Review
By this time you'll know what you can and can't do, and what's easy and what's just way too
tricky. You'll each discuss your detail in, um, detail with the group. We'll exchange ideas
and maybe I'll give up a secret or two to make your game writing a bit easier.
Week 5: A Good Start...
After a quick review of events and actions, you'll spend the rest of the class creating your
game. Questions are answered, and answers are questioned.
Week 6: ...Making Progress...
You'll learn some of the cooler Gamemaker tricks and get back to building your game.
Week 7: ...And We're Done!
A few more tricks and it's back to building. How do you know when you're done? The class
ends and I take your games away (until next week).
Week 8: Take a Bow
You each get a CD with your personally registered copy of Gamemaker and all of the games the
class produced. We'll share the games and see what you've created.
Need help? Send an e-mail to me at games@c-ease.com
action | How the game responds to an event. |
alarm | An action that causes an alarm event to occur a specific number of steps in the future. |
animation | A gif image may contain several individual images that are displayed in sequence to produce an animation. An Animation End event is fired at the end of the animation sequence. |
background | the image(s) that underlay the objects in a room. They are static, i. e. they cannot collide with or block objects. Several backgrounds may be laid on top of each other, and a background can be declared as "foreground" to allow it to be displayed over objects (e. g., clouds obscuring aircraft objects). |
event | a way of informing objects that something has happened. |
expression | a mathematical formula that describes an aspect of an action. For instance, to make an object jump a bit to the right of the mouse position, you might set the x position to mouse_x + 4. An expression returns a value. |
function | a (usually) complex expression hidden in a single operation. Functions are called by name and an argument, such as string_length("abcde") to return the length of the string "abcde". The most common function is random(arg) which returns a number from zero up to (but not including) "arg". Functions can be used in expressions. For example, random(6) + 1 would simulate a die roll (return a number from 1 to 6). |
gif | A common image format. Gifs can be animated. |
instance | an object, as it appears in the game. There may be multiple instances of a single object. In general, all exhibit the same behavior (that is, they look the same and respond with the same actions to the same events). |
key press | An event that occurs when a key is pressed, but not repeated when the key is down (as a keyboard event is). |
key release | An event that occurs when a key is released, but not repeated when the key is down. For instance, in a pinball game the plunger may jump to its start position at key press, move back during the keyboard event, and shoot forward when key release is detected. |
midi | A very efficient format for storing music. Generally used for background music. |
object | a template for instances. Objects define the events and actions of the instances, which actually appear in the game. |
persistence | how long something lasts. For objects, it determines whether it will exists from room to room. For a room, it defines whether the room will look the same when a user returns to it. |
property | A variable that is part of an instance. For example x refers to the current horizontal location of an instance. |
resource | Anything in the game: backgrounds, objects, sprites, sounds, tiles, etc. |
room | The screen upon which objects are placed. |
script | A block of code that you can write as an action |
sprite | What you see when you look at an instance in a room. |
step | The basic unit of "time" which guides the game. Normally, a step is equal to 1/30 of a second, but that can be changed. |
tile | Small bits of background that can be used to build up a complex room. |
variable | A way to save information to use later. Generally used in scripts; most game writers will use object properties instead. |
view | A way to display only a portion of a room at a time. |
wav | An uncompressed sound generally used to provide short sound effects during a game ("boing" for a bounce, or a short tune when a character dies). |
Name | Fired | Typical Action |
---|---|---|
Create | when an instance is created | start moving |
Destroy | just before the instance is destroyed | play a sound; create a new instance elsewhere |
Alarm | when the alarm "time" becomes zero | create a new instance |
Step Start | at the very start of the step | cancel an alarm before it's triggered |
Step | in the middle, just before instances are moved | test a variable |
Step End | near the end, before redrawing the room | snap to grid before displaying |
Collision | when two instances touch | bounce |
Keyboard | when a key is down | increase speed |
Key Press | when a key is first pressed | start movement |
Key Release | when a key is released | stop movement |
Mouse down | when the specified button is pressed and the mouse is over that instance. | increase score |
Mouse Press | when the specified button is first pressed and the mouse is over that instance. | play a sound |
Mouse Release | when the specified button is released and the mouse is over that instance. | move the instance |
Global Mouse Press | When any button is pressed and the mouse is anywhere over the game. | move toward the mouse pointer |
Global Mouse Release | When any button is released and the mouse is anywhere over the game. | |
Joystick direction | When the joystick is pointing in any of the four primary directions (two events will occur if the joystick is at a diagonal) | |
Joystick button | When the specified button is down | |
Outside | when the instance is completely outside the room | destroy the instance |
Boundary | when the instance touches the boundary | bounce |
Game Start | when the game begins | start music |
Game End | when the game ends | show hi-score table |
Room Start | when the room is first displayed | start alarms |
Room End | when the room is exited | pause and play music |
No More Lives | when the lives property is set to zero | end game, show hi score table, play music |
No More Health | when the health property is set to zero | reduce number of lives, reset health |
End of Animation | when the current sprite animation ends | destroy instance |
End Path | when the path the instance is following ends | restart path |
User Defined | when an action is to fire a user-defined event | |
Draw | when the instance is being drawn | draw sprite image based on direction of movement |
Action | Does |
---|---|
Start Moving In A Direction | choose one or more of eight directions and a speed to move at. Selecting more than one will cause a random choice. |
Set Direction & Speed | choose a precise direction (degrees) and speed |
Set Horizontal Speed | set the horizontal speed |
Set Vertical Speed | set the vertical speed |
Move Toward a Point | specify a point (x and y) and speed and move toward it at that speed. For instance, to move toward the mouse, set x to mouse_x and y to mouse_y |
Set a Path | select a path resource for this object |
Set Gravity | set a force that "pulls" the object toward a gravity point. Usually, the angle is 270 ("down") |
Set Friction | set a force that slows down the object |
Jump to a given position | specify a point (x and y) to move the object to. |
Jump to the start position | move the instance to its "create" position |
Jump to a random position | move the instance to some non-collision position in the room |
Snap to a grid | Ensure the object is on a grid position |
Reverse Horizontal | Reverse horizontal direction and speed |
Reverse vertical | Reverse vertical direction and speed |
Move to contact position | Move in the direction specified until a collision would occur |
Bounce | Change direction as if the instance "bounced" off the instance it collided with |
Create | Create a specified object instance at a specified location |
Change | Change the specified object into another object type |
Destroy | Destroy the specified object. |
Destroy at | Destroy any objects at a specified (x and y) position. |
Change sprite | Use a different sprite to display for this object |
Play sound | start a specified sound resource |
Stop sound | stop a specified sound resource |
if sound is playing | test to see if the sound resource is playing |
Goto previous room | End this room and start the previous room |
Goto next room | End this room and start the next room |
Restart room | Restart this room. |
Goto different room | End this room and go to a specified room |
If previous room exists | Test to see if the previous room exists |
If next room exists | Test to see if the next room exists. It is important to use this before going to the next room, unless you are certain there are more rooms. |
Set alarm | Set a specified alarm to trigger after a specified number of steps. If you want your alarm to be regular, you must put this in the alarm event |
Sleep | Freeze the game for a specified time |
Set timeline | Specify a timeline for this instance to follow |
Set timeline position | Specify a position on the timeline |
Display a message | Display a message box for the player |
Show game information | Show the "about" information you create |
Restart game | End the current game and start over |
End game | End the current game |
Save game | Save the current game state |
Load game | Load the game state |
If a collision | Execute the next statement if there is a collision at a specified location |
If no collision | Execute the next statement if there is no collision at a specified location |
If object is at a position | Execute the next statement if there is an instance of a specific object at a location |
If number of instances is | Execute the next statement if the number of instances of an object equal to, smaller than, or larger than a specified value |
If dice is 1 | Execute the next statement if a random number in the range you specify is "1". For instance, specify 2 to get a coin toss, or 6 for a die. |
If the user answers yes | Display a message and execute the next statement if the user answers yes |
If an expression is true | Execute the next statement if the specified expression returns true |
If a mouse button is pressed | Execute the next statement if the specified mouse button is pressed. The mouse can be anywhere within the game. |
If aligned with a grid | Execute the next statement if the instance is aligned with the grid. |
Else | Execute the next statement if the previous "if" section was not executed. For instance, [if the dice returns 1] move to start [else] destroy self would move to start if the random number was 1, otherwise the object would self-destruct. |
Start block | Use to execute more than one statement after an "if" or "else". Each start block must have an end block |
End block | End the block of statements. |
Repeat next action | Perform the next action (or block) a specified number of times |
Exit event | Stop executing actions for this event |
Draw sprite | Draw a specified sprite |
Draw background | Draw a background resource at a specified location. You can specify if it is to be tiled. |
Draw rectangle | Draw a rectangle. Specify the size and location. |
Draw ellipse | Draw an ellipse (or circle). Give the size and location. |
Draw a line | Draw a line. Give the start and end. |
Draw text | Draw text at a given location. |
Set color | Change the color of whatever is drawn next. |
Set font | Change the font for the subsequent text. |
Fullscreen mode | Change to full screen (arcade) mode. The windows taskbar and borders will disappear. |
Set score | Change the score |
If score is | Execute the next statement if the score has a specified value |
Draw score | Display the score in the room. |
Clear highscore | Clear the high score table |
Show highscore | Display the high score table |
Set # lives | Change the number of lives |
If # lives is | Execute the next statement if the number of lives has a specified value |
Draw # lives | Display the number of lives in the room. |
Draw # lives as image | Display a number of icons representing the number of lives. |
Set health | Change the health value |
If health is | Execute the next statement if health has a certain value |
Draw health bar | Display the health bar in the room |
Set caption information | Display lives/score/health in the title bar |
Run script | Execute a script (short code segment) |
Run code | Execute a longer code segment |
Set variable | Change a property for an object or instance. |
If variable | Execute the next statement if the property has a specified value |
Draw variable | Display the value of the variable in the room |
Call inherited event | If the object has a parent, execute the parent's event actions |
Comment | Information to yourself |
Property | Meaning | Example |
---|---|---|
x | Horizontal position of instance. Left is 0 | These all work together. If you create an instance at x=(room_width / 2) and y=(room_height / 2) it will appear in the middle of the room. Setting its vspeed=-2 and hspeed=2 means it will travel up and to the right. This is the same as setting the direction=45 (degree angle) and speed=2.83 (trust me). |
y | vertical position of instance. Top is 0 | |
hspeed | horizontal speed of instance. Right is positive | |
vspeed | vertical speed of instance. Down is positive | |
direction | direction instance is moving (0=right, 90=up, etc) | |
speed | vector speed instance is moving at | |
visible | visible status of the instance | To magically transport your instance, set visible=false (or 0) and change its position. Set an alarm for, say, 5 steps and when the alarm fires make it visible. It will reappear at its new location at that time. Keep in mind that collisions can occur even when invisible. |
image_single | show a single image from an animated sprite | Make a sprite that has images of your character facing left, right, up, and down. Use image_single to choose the appropriate one, based on direction. |
score | current value of score | Let's apply these
together. Use a series of "if expression"s: if score mod 10 = 0 then health=health + 10.
if health > 100 then lives = lives + 1. If lives > 5 then destroy all monsters. What that will do is eventually reward the player's skill. Here's the English: Every 10 points (mod 10 means "get the remainder when divided by 10"), add 10 health points. When health gets above 100, give the player an extra life. When the player gets six or more lives, destroy all of the monsters. These statements aren't perfect. For instance, you'll get an extra health when the score is 0, so it should only be placed after a statement that raises the score. Also, since the health stays above 100, every time this is executed you'll get an extra life. There needs to be a way to prevent that. |
lives | current value of lives | |
health | current value of health | |
mouse_x | horizontal position of the mouse | This can be used to create your own mouse pointer! In the draw event of any object, draw a sprite that represents the mouse at mouse_x and mouse_y |
mouse_y | vertical position of the mouse | |
xprevious | The x position at the previous step | If an instance moves to a "back" button, set the x and y to xprevious and yprevious. This would work whether the object stepped onto the button or "jumped" there. |
yprevious | The y position at the previous step | |
xstart | The x position at the start of this room | When a life is lost, set the instance's x and y to xstart and ystart to begin again without restarting the entire room. Pac-man uses this so the objects that were eaten remain eaten. |
ystart | The y position at the start of this room | |
show_cursor | set to true to display the cursor; false to hide it | If the mouse is unused, set variable show_cursor to false |
background_color | change the background color | using "set variable" to set backgdound_color to make_color(score, health, lives) will cause the background color to change as each of those three properties changes. At the start of the game, the background will be quite green. As health and lives go down and the score rises, the color will change to red. |
room_width | the width of the room | To place an object in the center of the room set x = room_width / 2 and y = room_height / 2 |
room_height | the height of the room |
Name | Function | Example |
---|---|---|
random(arg) | return a random number from 0 up to (less than) arg | to move in a random direction, specify random(360). To move at a speed between 2 and 5, set speed to random(3) + 2 (the result will be anywhere from 2 up to 4.999999999) |
round(arg) | return arg, rounded to an integer | All of these return an integer value when you need it. You may want to get adjust the player's score based on his remaining energy level at the end of a room. If the energy can be a real number from 0.000 to 9.999 you can be honest and use round(energy), you can be stingy and use floor(energy) or you can be generous and use ceil(energy). |
floor(arg) | return arg, rounded down to an integer | |
ceil(arg) | return arg, rounded up to an integer | |
min(arg1, arg2) | return the smaller of arg1 and arg2 | To double the current score, but not add more than 10 points use score = score + min(score, 10). To double the current score, but add at least 10 points use score = score + max(score, 10). |
max(arg1, arg2) | return the larger of arg1 and arg2 | |
point_distance(x1, y1, x2, y2) | return the distance from point x1, y1 to point x2, y2 | An exploding bomb may want to destroy an object if it is within 50 units of the bomb. You could test this with an "if expression" point_distance(x, y, enemy.x, enemy.y) < 50. Or you may want to move to the top left corner of the screen with direction = point_direction(x, y, 0, 0). |
point_direction(x1, y1, x2, y2) | return the direction from point x1, y1 to point x2, y2 | |
real(str) | change a string to a real number | When creating your own variables, you often will want to "stick them together" or add them, depending on their use. If you have two strings string1 = "10" and string2 = "5" and you display string1 + string2 you will see "105". If you have two numbers num1 = 10 and num2 = 5 and you display num1 + num2 you will see 15. You can change numbers to strings and back again with these functions. |
string(val) | change a real number to a string | |
string_length(str) | get the length of the string | If the player entered his name and there is only room to display five characters you can use an "if expression" to shorten it: if string_length(name) > 5 then string = string_copy(name, 0, 5). |
string_copy(str, index, count) | get a partial string. Returns count characters of str starting from index | |
instance_nearest(x, y, obj) | tells you which instance of type obj is closest to position x, y. | The zapper at x, y destroys the closest object to it: inst = instance_nearest(x, y, all); inst.instance_destroy(). There are three new things here: the first function returns the identity of that particular instance that's closest. Statements are separated by semi-colons. putting an instance or object type name followed by a dot followed by a function or property means "apply the function to that instance" or "use the property of that instance". So if I'm a paddle and I set x = x + 10, I move 10 pixels to the right. If I set x = ball.x + 10 I move 10 pixels to the right of the ball. |
set_cursor(cur) | display the cursor as a specific windows cursor. cur can be cr_default, cr_none, cr_arrrow, cr_cross, cr_beam, cr_size_nesw, cr_size_ns, cr_size_nwse, cr_size_we, cr_uparrow, cr_hourglass, cr_drag, cr_nodrop, cr_hsplit, cr_vsplit, cr_multidrag, cr_sqlwait, cr_no, cr_appstart, cr_help, cr_handpoint, cr_size_all | Use script to call set_cursor(cr_hourglass) and the mouse pointer will turn into the hourglass shape. |
Contact: games@c-ease.com