Objects

To create a new object, right-click on the Objects folder and "Create object".

In your room you put objects (such as balls, walls, characters etc.) . 

  • Some objects just sit around (like walls) and other objects move around and interact with other objects in the room.
  • We can have multiple instances of one object (ie monsters). 
  • If you want objects to be visible on the screen, you need to choose a sprite for it.

How to add an object:

  1. Give your object a name.
  2. Choose a sprite from the drop-down menu (if it will be visible on the screen).
  3. Change other properties, such as make it solid; default is visible.
  4. Add Event.
  5. Add Action(s): = result of an event; may cause 1+ actions. Actions are grouped into tabs (on the right side)

Cause (Event) &...

  • player pressing a key on the keyboard
  • game character colliding with a wall
  • 2 objects meeting on screen, = a collision

Effect (Action)...

  • object bounces
  • score increases
  • sound plays


Tips:

You can duplicate an object to save time. Then just change the  object name and sprite. You may also have to tweak a few actions.


  • Don't make moving objects solid.  It interferes with the Game Maker collision detection system and your object may become 'stuck'. 
  • Name your sprites & objects properly.
    • If you name every sprite sprXXXX you will not have any problem separating them from the objects which we will call objXXXX.
    • Only use normal characters like letters, numbers and underscores when making a name.
    • Never use spaces or weird characters like slashes, asterisks, dollar signs, ampersands, and similar.
    • Also, don't start with a number, use it only later in the name.

Depth

  • Instances with highest depth are drawn first.
  • Instances with lower depth are drawn on top of them.