I am using the following if statement:
if(main.incometr == true && main.turn == 4){
main.trc = main.trc + 40;
main.incometr = false;
main.incometb = true;
};
It is nested in a switch statement, this all works just fine. What happens is this: at the end of a turn team red is granted 40 gold income. The boolean "incometr" (tr/b meaning team red/blue) is set false since they are granted their gold. The boolean "incometb" is set true because they will get their 40 gold at the end of next turn. They alternate like this every turn.
This works allright.
Because I have several factors influencing the gold income for every turn I made a variable "trci" (team red coin income). It is set a standard of 40 and changed during turns depending on several factors. This changes the above if statement into the below if statement:
if(main.incometr == true && main.turn == 4){
main.trc = main.trc + main.trci;
main.incometr = false;
main.incometb = true;
};
Since I draw the variable "trc" (team red coins) into a Bitmap I can see the value. Instead of returning something like (team red coins)+(team red coin income)=540 the value will explode and end up being above 10000's, it's a different value each time aswell.
I hope I made myself clear and someone can help me. Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire