Name: __________________________________________
Copyright
by
The
Goodheart-Willcox
Co.,
Inc.
Lesson 3 Click Ball 33
Programming Conditions and Events
Remember, Game Maker uses events and actions to create the interactions needed in a
game. Your game does not yet have any programming, only scene design. The first programming
is to create an event for the ball to move in a random direction. Random actions and chance
allow for games to be unpredictable and more fun when they are replayed.
55. In the resource tree, double-click on the OBJ_Ball leaf to open the Object Properties
dialog box. Notice the Events: and Actions: columns. These columns are used for
programming.
56. Click the Add Event button at the bottom of the Events: column. The Choose an
Event to Add dialog box is displayed.
57. Click the Create button in the Choose the Event to Add dialog box.
An event is added that translates to:
IF the OBJ_Ball object is created, THEN perform all actions displayed in the
Actions: column.
Right now, the Actions: column is blank, so you need to add something cool for the ball to do
when the game begins. The fi rst action will be to make the ball object move.
58. Click the Move tab on the right side of the Object Properties dialog box, Figure 3-8.
59. Hover the cursor over each button on the fi rst row to fi nd the Move Fixed button. Drag
this button and drop it onto the blank section of the Actions: column. The Move Fixed
dialog box is displayed and the Start moving in a direction entry appears in the Action:
column.
60. In the Move Fixed dialog box, click the Self radio button in the Applies to area, Figure 3-9.
Since you are modifying the properties of the OBJ_Ball object, this means that the
selected movement will apply to that object (self).
Click the
Move
tab
Drag the
Move Fixed
button
into the
Actions:
column
Figure 3-8
Move
Fixed