Help, tutorials and examples for Game Maker

Paper Flight
click to visit
3D racing game with custom paper airplanes.

Infinite Stick War of Death V3
click to visit
The third remake of the epic, endless war God has started.
The Invention of Life
click to visit
Game for the GameJolt Invention Contest.

Guliseo Spirit
click to visit
Battle your way through 15 action-packed worlds!
Home Search/Browse Comments Trollsplatterer You can help! Links
Terms&Conditions This website has been designed for Firefox Design by Trollsplatterer (©2018)

Gathering Resources  download now

This is an example about resource collection for top-down games. In RTS games, there's usually a way to gather resources such as food, wood, gold... This example gives a good clue as to how you can build something like that. The code will require some modifications to make it look more realistic (obstacles, enable to influence the transporter), but this is a good start. All code is in GML, no D&D actions.


General Rating
Your Rating*


Gathering the first resources
Gathering the first resources There are 3 types of visible objects. The blue ball is the transporter. The red balls are the gathering locations and the green balls are the resources. Each items indicates the amount of reources which it contains.
Transport to the gathering point
Transport to the gathering point When the transporter is filled to its maximum, it returns to the closest gathering point. When the goods are loaded into the gathering point, the total amount of goods, shown at the top-left side of the window, also increases.
Filling up
Filling up As long as the transporter isn't filled 100%, it keeps moving to the next resource.
All gone
All gone When all resources are gone, the transporter moves to the closest gathering point to load off the last resources. Then it stops and waits for new resources to appear.


By Comment
There are two ways of using Game Maker, D&D (the actions like Move Horizontal or Set Vertical Speed) and GML (programming language to replace the D&D actions).

The Execute Code action runs GML code which you have to write yourself, but you'll have to learn how to use GML first.
I have a GML tutorial on the main page and you'll find many others on the internet. You'll find all GML variables and functions in the Game Maker help file.
whats the whole execute code about and where are you supposed to get the codes from???
Thanks. It looks like I'm going to have to update the screenshots a bit, though, they are a bit messy.
I may enable PNG compatibility for the screenshots one day, that'll get rid of the blur-effect.
This is Goku Kid and i must say!, Very Good Work!

* : The rating makes use of your IP-address to remember your vote. IP addresses may change, but your vote will be kept, even though it may no longer be visible here.