<aside> <img src="/icons/list-indent_purple.svg" alt="/icons/list-indent_purple.svg" width="40px" />

Navigation

</aside>

<aside>

Try the Recipe

</aside>

What is this recipe

A Hazard2D is an object in the game world that inflicts damage or kills the player. Essentially, it's a hitbox with some kind of mechanic behavior.

A Hazard2D doesn't have any kind of intelligence. Though, we can add artificial intelligence to it, and it becomes an active enemy.

You can find this recipe everywhere, as some examples:

In Ori and the Blind Forest, a lot of the environment is made out of Hazard2Ds.

Figure 5.1 - Ori and the Blind Forest hazards highlighted

Figure 5.1 - Ori and the Blind Forest hazards highlighted

We can find this recipe on Flinthook as well, there are many mechanical gadgets around ships that are Hazard2Ds.

Figure 5.2 - Flinthook hazards highlighted

Figure 5.2 - Flinthook hazards highlighted

And, as a final example, in Hollow Knight, we can see them all over the world. Besides the game really focus on enemies and boss battles, Hazard2Ds play a major role in the world design as well.

Figure 5.3 - Hollow Knight hazards highlighted

Figure 5.3 - Hollow Knight hazards highlighted

These examples show the versatility of the Hazard2D recipe, but they only scratch the surface of what's possible. Now that you've seen what this recipe can do and where it fits in your game, let's explore when and why you should reach for this particular tool in your design toolkit.

When to use this recipe

Obstacles are a fundamental aspect of a game. They are there to prevent the player from reaching the game's goal.

We use a Hazard2D as an obstacle that, if the player doesn't understand how it works, will punish the player.

Since games are systems of incentives, we must tell players when they are doing something desired or undesired for the game’s purpose. When players do something that moves them in the direction of the game's goal, we reward them. When they do something that moves them away from the game's goal, we punish them.

So, whenever you want to add a sense of punishment for players' actions in your platformer game, a Hazard2D can be an option: