Trollsplatterer

Help, tutorials and examples for Game Maker

Guliseo Spirit
click to visit
Battle your way through 15 action-packed worlds!

Paper Flight
click to visit
3D racing game with custom paper airplanes.
The Black Hole that Wants to Eat Me
click to visit
Stranded in space close to a black hole...

Platformer Engine
click to visit
An Engine to help you start a 2D Platformer Game.
Home Search/Browse Comments Trollsplatterer You can help! Links
Terms&Conditions This website has been designed for Firefox Design by Trollsplatterer (©2017)

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.

Ratings

General Rating
Your Rating*

Images

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.

Comments/Suggestions

By Comment
Trollsplatterer
2010-02-10
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.
lewis
2010-02-10
whats the whole execute code about and where are you supposed to get the codes from???
Trollsplatterer
2010-02-08
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.
Anonymous
2010-02-05
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.