0
How do I stop from going into the negatives
If you click âFightâ then âKeep fightingâ it will eventually go into the negatives can someone make it go to zero thanks (Feel free to add your name up top) https://code.sololearn.com/WcxHstyrj1Ux/?ref=app
2 Answers
+ 1
https://code.sololearn.com/W7CYVP5jMe80/#js
0
Can you use an if statement to avoid this? something like:
if (x < ) {
x = 0;
}
Your variable will never go below zero that way.