Let’s tackle 1 - Boolean Basics 😎

Understanding Booleans

boolean values represent true or false. In Robocode you often use them to track simple on/off states.

boolean targetLocked = false;

You can flip the value when a condition is met:

if (getGunHeat() == 0) {
    targetLocked = true;
}

Booleans help your robot remember whether something has happened yet.


⬅️ Back: HitByBulletEvent ➡️ Next: If Statements