I am wondering how easy it is for a user/browser to manipulate or execute Javascript code manually.
The reason I ask is that I am planning on making a browser-based game. I am using Javascript instead of Java because I want to make it accessible to as many platforms as possible.
Here is a general example of what I mean: the user might go to a game page. Several variables would be stored in JS such as, say, the player's health and strength values. The player might choose to attack a monster and the outcome is determined from several stored variables and a couple which were generated during the battle.
So would a player be able to manipulate the stored variables or call one of my JS functions (such as one which leads to an AJAX call being made)?
If so then how could I guard against it? I could verify each action with the server but that is bandwidth-intensive.