mercredi 26 août 2015

if Function Modifying - Javascript [on hold]

I have an if function:

if (swag = 0) {
   increase-swag code
}

The variable swag is varying. swag is decreasing from 100. When swag hits 0, I want some code to run, the increase-swag code. This code will make swag increase. But, to the tricky part, when swag is increasing it is no longer 0. This will stop the increase-swag code from running. And I am stuck in some -+-+-+-... - situation.

To conclude: I want some code to run when a certain requirement is fulfilled, but I want the code to keep on running even when the requirement is not fulfilled any more.

Thanks, ask/comment if some swag is unclear!

Aucun commentaire:

Enregistrer un commentaire