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

Introducing: TestDX


Screenshot of program

I'm pleased to present you TestDX, a test&benchmark program that I've developed a week ago for one of courses in university.
This program tests a set of characteristics, some of which are related to behaviours in GameMaker games specifically.
Program includes English and Russian localizations, with additional ones being easy enough to add (if wished).
It can be considered non-interactive (apart from being able to pause tests at any time by pressing a key), however visual presentation is kept at good level, making two minutes, that it takes program to perform all tests, worth looking at.
To keep things 'transparent', a source is included in download. There is no set license for it, but makes itself useful, if you're curious, how everything works in test.
Some of code in source is quite rushed (often done in spare minutes), but I've added documentation to all scripts, and generally code style is kept intact.

Download

Description of specific test results below.
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

Love2d: A game in 8 minutes


A video.

Yesterday I've made a game in Love2d. In a bit over 8 minutes.
Originally I planned to get everything done in 5 minutes (similar to previous GameMaker-related post), however I somewhat overrated my ability to type 3-segment function names that I'm not that similar with.

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