Hi!
I'm using JavaScript to manage many variables in my game. Now, I want to add a simple number that can be held and added to throughout the game. So, for example, When you click a link or button, it will add or subtract 1 from the value. Here is my work.
Maybe I'm missing something? Is my code wrong? Please help!
I'm using JavaScript to manage many variables in my game. Now, I want to add a simple number that can be held and added to throughout the game. So, for example, When you click a link or button, it will add or subtract 1 from the value. Here is my work.
<% function rStatus(rank) { return rank + 1; //Adds 1 to the initial value// } rStatus(0) //This is the inital value// %>Then later, in my story I want to call back to this number and say something along the lines of "Your rank is rank". Here is my code for that.
<% print("Your rank is "+rank); %>Now for some reason no matter how I run it, it will usually bring up and error that says "sStatus or rank is undefined"
Maybe I'm missing something? Is my code wrong? Please help!