I have a system where if the hero takes damage, an invincibility counter starts (it gets set to 0).
In my update part of the code, I have set it to
//Invincibility
if (staticInvincibilityCounter != staticInvincibilityCounterVal)
{
//Only tint every x sec
if (staticInvincibilityCounter / 3 == int)
{
spritemap.tintMode = 1;
spritemap.color = 0x870E2D
}else {
spritemap.tintMode = 0;
spritemap.color = 0xFFFFFF
}
staticInvincibilityCounter++;
}else {
spritemap.tintMode = 0;
spritemap.color = 0xFFFFFF
}
The part “staticInvincibilityCounter / 3 == int” is what is bugging me. I am trying to make it so that if the counter divided by 3 produces an int, it will tint the hero. This way, it will only tint it every 3 milisec, but I can’t seem to understand how to make it work…