Creating relationships between objects where specific actions generate desired outcomes.
In this section of the Game Maker Academy, we will be unpacking how to use logic in the Game Maker.
We will take a quick look at what logic is and how it can be used, and then we will dig into how you can actually apply that logic using the Game Maker tools; like Behaviours, Components, Messages, and Tags.
So, let's start at the beginning. What is Logic in this context?
When using the Game Maker, we’re referring to Logic as a series of interactions and rules 🚦 that define potential outcomes.
Essentially, logic is about the variables that define what happens after a specific action occurs.
To keep it simple, we can think about logic in the Game Maker in the same way as we think about the physical world.
If you turn on a light switch, an electrical message is sent through wires, and when that message is received by the light, the light will turn on 💡.
We can also achieve this kind of relationship in the Game Maker, for example, you can create a sequence where if a button is pressed, a message is sent 📡, then a door will open.
This represents a simple logical chain, showing how a relationship between the action and the outcome can be established in just a few steps.
Establishing these relationships of cause and effect is essential to bringing variety and depth into the experiences you create.
You are, of course, able to establish more complicated chains of logic 🧾 depending on the experiences and outcomes you are aiming to achieve.
An example of a slightly more complex series of events would be that, instead of just pressing the button to open the door, you need to have collected a specific item, let's say a key 🗝️, before the button will work, and the door will open.
You could apply this same logic to a TNT 🧨 detonator. When a player, who has the key to the detonator, presses the button, then the receiver of that message could be destroyed as a result.
While these are different scenarios, the important thing to note here is that each example relies on a similar underlying logical flow. The steps and connections follow a similar pathway.
Understanding this empowers you to think about how you can establish steps in a logical chain 🔗 to achieve a variety of outcomes.
In terms of application, each of these examples relies on implementing a series of underlying customizable 📢 components, behaviours, messages and tags.
In case this topic leaves you feeling a bit out of your depths, hang in there, remember that the Game Maker does a lot of the heavy lifting for you, and while you can use the tools to create complex interactions, you also have the ability to use some pre-designed plug-and-play tools to establish some of these connections for you.
That being said, once you have a handle on the basics principles, you might surprise yourself at how quickly you are able to start applying more complex layers of logic when designing your experiences.
So let’s get moving so you can get testing.