GameMaker: Multi-version argument_count
Continue reading
⚂ All takes time
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.
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.
Illustration
Source code follows,
Continue reading
Screenshot of program
It's actually pretty hard to describe what this does without an image.
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.
Code follows,
Continue reading
A video.