home | et13 - game prototyping in Gamemaker prev | next

David Javelosa
javelosa_david@smc.edu

Copyright © 2001-2020, David Javelosa unless otherwise stated.

 

week 03 - more Gamemaker basics

Form and Function in 2D Game Design


Additional Object Features

(Using the "hit the ball" example included with Game Maker)

Bounce and Gravity

In addition to changing the movement, speed and direction of an object, it is possible to bounce and curve an object's path. To do this,

  • go to the Objects folder and select properties for the ball_object
  • Add the event "collision"; with wall_object; and the action "bounce against solid objects"
  • Note that the wall_object is checked SOLID, and the ball_object is not! That is because we are bouncing the balls against the wall objects but NOT each other.
  • Try both settings of "precise" and "not precise". Also try bouncing against different shaped objects (flat vs. round) with these variations.
By adding gravity to the bouncing ball objects a more natural movement curve is attained. However, without relative decay, the bouncing objects will accellerate against the solid boundries against the gravity.
  • go to the ball_object's event "create" and add the "set the gravity" action
  • applied to self, give it a downward direction (270) and a gravity of .5 and test. Notice the curve to the bounce and how it eventually overcomes the gravity effect.
  • Try the same with the "relative" option checked. Both the direction and gravity strength will be affected but both will eventually be overcome by the strength of the bounce.

Outside of Boundry with Wrap

  • delete the wall objects from the room; delete the "collision" event from the ball_object
  • select the "other" event "outside room"; select the action "wrap when moving outside"
  • select "in both directions" from the action box

Modifying the Room

Characteristics of the room can be set by selecting ROOM properties. Under the Settings tab, you can set the room size, shape, and caption for the room. A background image must be loaded as a Background resource before it can be used in a room. From the Background tab, it can then be assigned to a room.


GIF Animations

GIF and sprite animations are a way to encapsulate number of still images into a single sprite.

CREATE THE SPRITE ANIMATION CYCLE

  • Create or load a series of animation frames as a GIF file
    • modify colors of an existing series of animation cels
  • Explore GIF examples from Game Maker resources

CREATE AUTOMATIC and INTERACTIVE MOVEMENT WITH ACTIONS

  • Create object with an animated GIF file as a sprite
  • Give movement actions to the object in the "create" event
  • Give navigation actions to the object with animation
  • Change the animated GIF file with each navigation direction movement

Navigating Rooms
  • Create 2 rooms
  • Create 2 control sprites: Start and Return
To navigate to a room:
  • go to next room
  • go to previous room
  • restart room
  • go to different room

More Events and Actions

More Events
  • destroy instance
  • mouse events
  • start event
  • end event
  • room start
  • no more lives - scoring
 

More Actions
  • Create instance
  • change speed
  • change direction
  • random position
  • change instance
  • change sprite
  • play sound stop sound

Operational Actions

  • IF statement true
  • Block structures

Commonly Used Actions

Navigation- Multiple Rooms

Navigation - Positions - room to room, within room

Sound- play one off sounds - buttons, events

Play Background Music - Play looping audio or MIDI per each room.

Rollover Sprite Change. Mouse events, over, down, up for navigation (ready, set, go)


Exercise

Create a GameMaker game that's composed of two rooms. The first room has one object on it that causes the game to go to the second room, which has an animation cycle (i.e. GIF file) or is moving around on the screen. The second room should also animate forever, unless an object in the room is clicked on to cause the game to go back to the first room.

  1. Create an object that says "START"
  2. navigate

For extra credit

  1. PLAY SOUND on the START object
  2. PLAY SOUND on the STOP object
  3. PLAY background music in each room

    Assignment: REVIEW Chapter 3 - Game Maker's Apprentice - Galaxy of Possibilities


    CONCEPT DOCUMENTS DUE NEXT WEEK!!

Copyright © 2001-2014, David Javelosa