GameMaker 5 Examples

These examples have been written to help others learn how to do various things with GameMaker 5. Most of these were written to answer one or more questions posted in the GameMaker forums. These may not be the best way to do what they are doing, but they might help you. Feel free to make use of anything you find here in your own games.

Note: These examples were converted from Game Maker version 4 to Game Maker version 5 by Rupert Russell the original files are located at:

http://www.ladimaco.com/GameMaker/examples.html

Example Name
Description
Download Link
  All the following examples in one zip file all.zip (1,540 KB)
Ammo shows how to use a counter for ammo, including picking up objects for more ammo. ammo.zip
Background Music Shows how to queue multiple midi files, to be played one after the other. backgroundmusic.zip
Boardgame Shows simple movement around a square game board. boardgame.zip
Bombs Shows how to track the order that bombs are placed, and detonate them in order (D key detonates the bombs) bombs.zip
Boomerang Shows how to create a boomerang effect. boomerang.zip
Buttons Shows a simple way of creating a set of buttons that can be selected with the keyboard. buttons.zip
Cards A playable game of Pyramid Solitaire (generic but good to see an easy way to shuffle and deal cards) pyramid.zip
Centered Keep a player centered in the screen while scrolling. centered.zip
Coins Shows how to open a secret door, after 4 coins are picked up. coins.zip
Color Shows how to get the RGB values from the Decimal color code. color.zip
Dice Shows how to use Dice in GM (With an image of a die) Good for a board game. dice.zip
Direction A good multi-purpose example, showing 2 player (one system) movement are fireing in 8 directions. direction.zip
Display Shows how to add a mouseover popup with information about an object. display.zip
Drawname Asks for your name, then draws it on the screen. drawname.zip
Energy Shows how to place an energy bar in the lower left corner of the screen. energy.zip
Explosion An object in the middle of the screen blows into a LOT of little pieces. explosion.zip
Face Mouse Shows how to keep the player facing the mouse pointer. facemouse.zip
Fire Shows how to make an emeny fire continously. fire.zip
Fog of War Shows one way to do a fog of war. fog.zip
Gas Shows how to use Gas in a car, No gas=no movement. Complete with gas pumps and multiple cars, each with it's own amount of gas. gas.zip
HealthBar Shows how to easily add a health bar to any object in your game. HealthBar.zip
Hearts Shows how to use hearts, simular to Zelda (so I am told). hearts.zip
HighScores An object and scripts to add multiple highscore tables to a game. highscores.zip
Horizontal Shooter An example of a horizontal space shooter. horizontalshooter.zip
Invaders An example of a simple Space Invaders clone. invaders.zip
Inventory An example showing how to add inventory slots to a game, with only certain types of inventory allowed into a given slot. inventory.zip
Line Editor Show how to do a simple line editor, to edit a text file. LineEdit.zip
Lives Shows how to add and remove lives, and represent them with a heart in the corner of the screen. lives.zip
Mouseshoot shows how to use the mouse as a crosshair, to aim your shots. mouseshoot.zip
On Road shows how to make a police car stay on the road. Primative, and probably not the best way to accomplish it, but it works. Will need some tweeking to look good in a game. onroad.zip
Pacman Shows how to buffer a movement command, until it can be used. pacman.zip
Paralax Scrolling A simple way to do paralax scrolling backgrounds paralax.zip
Radar An example showing how to have a radar track multiple objects, and display their position. radar.zip
Radar Version 2 Above example Modified by Chronic, to display ANY object in the room radar_v2.zip
Relative Shows how to display the players score above their head, as they move around. relative.zip
Shot Chase Demonstrates how to fire toward an object and also how to do homeing missle shots. shotchase.zip
Snake An example showing the Movement and Growth in the classic "Snake" type game. snake.zip
Spiral Shows how to make a bunch of objects spiral away from a centeral object. spiral.zip
Talk An example of a 15 line text display, for use in RPG's for character dialog. talk.zip
Timer Shows how to add a timer to a game. Uses a timer bar at the top left of the screen. timer.zip
Two Shots Demonstrates alternating shots from both sides of an object. twoshots.zip
Vertical Shooter Example of a vertical space shooter. vertical.zip
Walk Around Shows how to get a player to walk around a block in it's way. walkaround.zip
Examples by Alex LeDoux and KoolKitty
Board Game This will help you write your own board games. Boardgame.zip
Menu An easy to use autorun menu system.(KoolKitty also claims authorship of this example) Menu.zip
Slot Machine Shows how to do a slot machine. NOTE: Images are copyrighted by Alex. You must change them in your own game. SlotMachine2.zip

I hope these are of some use to you. I will keep adding here, as I write more examples for people from the forums.

If you are needing an example written to show how to do something with GameMaker, feel free to ask, and if it is something I can help you with, I will.

 

Larry

larry@ladimaco.com