A tactical procedurally generated game in the making

Menu

Suicide Bug (or Never Use Magic Numbers)

If you are a developer you should be familiar with the concept of magic numbers, or magic constants. In short these are values written “in clear” inside your source code. Also you should know that you never, EVER, use them, otherwise you may end up with your boss monsters going suicidal!

As you may notice there is a “PLAYER” written in there. Well that is the faction of the enemy, and that is why our summoned Efreet decided to self-terminate: since its own faction was “PLAYER” (because he was summoned by the player) he considered himself an enemy!

There is a lesson to be learned, again, in there: laziness is not the way to go, most of the time (you may also be able to spot a singleton, most say that this is also a mistake, maybe I will write a bit about this topic another time).

If you want to take a look at the source code of Wizard of Unica you can find it hosted on GitHub.

Follow Wizards of Unica

Enter your email address to follow our adventure and receive new posts by email. We never spam. We dev!

Join 1,817 other followers

Wizards of Unica – Alpha 0.2 FREE DOWNLOAD!

Wizards of Unica - ALPHA 0.2
PLAY FOR FREE NOW!
Available for PC.
Low-Res Tactic. High Fantasy.
Share your feedback with us!

Spare a coin for the Wizards!

Wizards of Unica is completely independently developed, by two nice guys who joined together to make their dream of making games come true. Wizards of Unica will be free-to-play: if you like our work, help us to create a bigger, better, harder game!