Hazard progress is well underway, and has led me to discovery a whole range of previously untouched Game Maker functions. Here’s a run down of what’s gone on in the process…
The Deceitful Blossom
Not quite so evil-looking at 16 pixels high… This has been the easiest obstacle to create. I’ve created an obstacle parent mask that means that I only need one collision command when the player runs into any obstacle. When this mask object is contacted, the global.health setting (which controls player HP) is reduced by one, as this is a constant for all obstacles! I’ve added a character flash-to-alpha effect when an obstacle is touched, which temporarily disables health from being reduced for a set amount of time while the player has a chance to get away. Those familiar with 2D platformers will be familiar with this, and would definitely expect something similar. I’ve compiled this video montage so you can see what I mean…
In the case of the Deceitful Blossom, the obstacle is destroyed on contact. This prevents the player from frustratingly walking into the same blossom more than once.
With the Hello Mushroom, I’ve looked into particle functions in order for the object to release periodic spore clouds which cause damage to the player. I’ve used particles before in motion graphics, and Game Maker’s handling of particles is very similar. You can completely customise particle aesthetics and behaviour without having to create a sprite first. For my small spore cloud, I’ve gone for a short release of small particles which shoot straight up into the air. They have a slow speed and a short life-span to make them look light and airy.
I’ve placed the Hello Mushroom in this cave here, and you can see a part of the cloud dissipating. I’ve essentially used a timer to create a period burst, and custom collision masks so that the spores cause damage as well as the mushroom itself. I used this little tutorial for help with a custom collision mask, as Game Maker doesn’t allow mask changes for objects that don’t change shapes themselves, and won’t allow collisions with particles.
The Hanging Adversary
The green thing that looks like an upside-down cannabis leaf in the screenshot above is my Hanging Adversary sprite, which currently swings like a pendulum and takes advantage of Game Maker’s abilities to draw connecting lines. This is another example where the darker green line isn’t part of a sprite which I have pre-made, but is constantly being drawn, refreshed and redrawn by the software. The clever part is, the swinging process isn’t based on a set movement, but is defined by settings such as mass and velocity…
The drawn elements originally created looked a little like this. This was adapted from a code I found on the Game Maker Community forums, which creates randomly swinging circles on these very long lines! The grey lines demonstrate the boundaries of the swing, so it was really simple to get from this to a smaller, non-random swing motion.