Ok so I have this game I am working on and I am trying to stream line it a bit by cuting out a lot of the if else statments by replacing them with this;
But when I debug the ninja hp is not updateing when I press s, but it ninja hp is decresed when I press v or x. Am I writing something wrong here?
Thank you
Thanks for the input;
I tried the
scanf("%c",&button);
but it still gave the same problme but thne it went though the simulation twice instead of once.
die is an integer from 1 to 100. Therefore die/100 is one if die==100 and zero in every other case. Fix it by doing it die/100.0. This forces your compiler to make a double division (instead of int). It should be fine now.