04 - Control Actions Powerpoint

GAME:IT
Learning Game Maker:
The Control Tab
Check Empty:
This question returns true if the current
instance, placed at the indicated position
does not generate a collision with an object.
 This action is typically used
to check whether the instance
can move to a particular
position (or is it being
occupied by something
else?).
Check Collision:
This is the reverse of the previous action. It
returns true if there is a collision when the
current instance is placed at a given
position.
Check Object:
This question returns true if the instance
placed at the indicated position meets
and instance of the indicated object.
Test Instance Count:
You specify an object and a number.
 If the current number of
instances of the object is
equal to the number – the
question returns true –
otherwise false.
 This is often used to check
whether all instances of a
particular type are gone—in
Pacman—when all coins are
gone—go to the next room.
Test Chance:
You specify the number of sides of
a dice which is then thrown.
 Then as the dice lands on
one, the result is true and
the next action is
performed.
 This can be used to put
an element of
randomness in your
game.
Check Question:
You specify a question.
 A dialog is shown to the player
with a yes or no button. The result
is true when the player answers
yes.
Check Question:
This is the most general question action.
 You can enter an
arbitrary expression. If
the expression
evaluates to true
(number greater than
0.5) then the next
action is performed.
Check Mouse:
Returns true if the indicated mouse
button is pressed.
Check Grid:
Returns true if the position of the
instance lies on the grid.
 Used in mazes to make
sure that instance doesn’t
“catch” on a turn or
corner.
Start Block:
Indicates the start of a block of
actions.
Else:
Behind this action the else part follows—
that is executed when the result of the
question is false.
Has player run out of lives?
True
End Game!
False (Else)
Go to Next Room
Exit
Exit Event:
When this action is encountered no
further actions in this event are
executed.
End Block:
Indicates the end of a block of
actions.
Repeat:
This action is used to repeat the next
action a number of times (you indicate
the number).
Execute Code:
When you add this action, a form
pops up to type in a piece of code to
execute (GML).
 Use for small pieces of code—
longer will use scripts.
Comment:
Action does not do anything but helps
you remember what your events are
doing.
Set Variable:
Allows you to assign values to variables
Application: Give the
player 3 lives to start
game.
Test Variable:
Checks to see if the variable has reached
a certain point.
Application: Has
lives reached 0
(after which you
would end game).
Draw Variable:
Allows you to see the value of a
variable on the screen.
Application: Pinball score located
right in the middle of the pinball
machine.
Advanced Mode
Call Parent Event:
Every object can have a parent object. When an object has a
parent, it inherits the behavior of the parent.
Application: If you have 4 different balls, named ball1, ball2,
ball3 and ball4, which all behave the same but have a different
sprite, you can make ball1 the parent of the other three. Now you
only need to specify events for ball1.
Execute Script:
In the advanced mode you can create scripts with GML.
This action tells the computer it’s time to activate the
script (GML).