GameMaker: Turn-based battle engine

Today I've spent some time making this intermediately impressive turn-based battle example.
It supports infinite number of unit "teams", configurable properties, inheritance, and more.

Built-in system will also attempt to reduce chances of developer (you) accidentally messing up something.
And there's easily configurable AI built-in too.

Overall, I somewhat got carried away while making original example, which was planned just include turns with unit selection.

Download GMK

GameMaker: View following two objects at once


This example is going to be of great use for everyone making local multi-player games, as well games requiring to display two objects on screen at once generally.
Effect here is, that view is positioned and scaled (if needed), to include two given instances at once.
Example provides a single function that does this sort of trick for you, absolutely painlessly and easily.

Download GMK

GameMaker: Connectable objects


I'm not a specialist on topic of weird helicopters, but this looks like one.

This secretly awesome example provides a system to 'connect' objects together, meaning that 'child' objects will be positioned relative to their 'parent' in means of both position and rotation.

Also you can (in turn) also make those 'child' objects 'connectors', meaning potentially infinite number of 'levels' of instances behaving separately.

For ones that might have this example from my old website, it is worth checking out again, since it has been rewritten almost completely, delivering quite cleaner naming, as well as easier access to child object properties, and some optimizations.

This example can be particularly useful for games involving 'modular' vehicles, as well as multi-object bosses.

Download GMK

GameMaker: Tower defense path-finding


Most of units turning back to take advantage of appearing hole in the maze

This example may be useful for ones making games of Tower Defense genre, as well as other games that require instances to dynamically re-adjust their path as new obstacles are being added.

System, included in this example, recalculates paths only when needed, thus providing minimum resource usage.
As well it detects if units have been blocked (to exclude possibility of cheating by enclosing units), and has a lesser sub-system to recycle & reuse paths.

Overall, should be intermediately useful.

Download

GameMaker: Pointing to an off-screen object


Illustration

This intermediate example demonstrates, how to create a rather nice interface element being an arrow that points between a on-screen object (normally player) and a off-screen location, that needs to be reached. In this case, arrow indicates exact direction to target, and is made to clamp accurately to screen edges (preserving direction vector), to avoid confusion on behalf of player.
Such feature is specifically useful for exploration games, where goal(s) may be at different distance from player, and some guidance is required.

Download

Source code follows,

Continue reading

GameMaker: Orbiting


Interactive demo. Mouseover to activate, drag planets around.

This is an example of making an instance orbit around other instance in GameMaker.

In contrast to other similar examples (and commonly given advice of the kind), it allows to define orbiting speed in a common way (pixels/frame instead of degrees/frame).

This is accomplished by calculating the distance to orbit' center (from current position), calculating the orbit' length, and thus converting pixel speed to degree speed.

New position is then calculated and instance' speed is adjusted for it to reach it the next frame.
This allows to use direction in collision calculations as per usual.

Overall, the code is simple enough but documented regardless.

Download GMK

Code follows,

Continue reading

GameMaker: 8-way shooting with 4 keys


This is a specific example for shooting in 8 directions by having 4 'shoot' keys, which, in different combinations, determine direction. While not being exactly a common control scheme, in some situations this proves to be better than different schemes with single attack button, as it allows projectiles to be fired in directions independent from movement, essentially granting something similar to 'analog sticks' of gamepads.
Example is simple, well commented, and would be rather easy to implement.

Download GMK

GameMaker: “notification” window


In the example, 'notifier' is just being annoying on purpose

This is an example for adding smooth-looking slide effect to game's window in GameMaker.
I suppose that ones to use my old program 'GMConverter' might have seen it there.
Despite of simplicity, it doesn't seem to be a common thing to see in games and applications.
Taking low ability of people to understand my original code, this example is well-commented and attempts to simplify usage where possible.

Download

Continue reading