Prevent Javascript games tweaking/hacking
<p>Thanks to the recent browsers enhancements, developing games with canvas and javascript has become a good option, but now that the code is easily accessible, just writing</p>

<pre><code>javascript:score=99999
</code></pre>

<p>or </p>

<pre><code>javascript:lives=99
</code></pre>

<p>Will spoil the game objectives.</p>

<p>I know that with some server-side checking something can be done, but I would prefer to access the server just to store player stats at the end, or even have it client only in most cases.</p>

<p>I wonder if at least the are some <em>best pratices</em> to start with.</p>

<p>(using <em>not so obvious</em> variables names is a start, but not enough)</p>

<p>-Added-</p>

<p>Thanks for the replies, I was looking to improve the client-side code, enough to stop "casual hackers", but still leaving the code as clean as possible.
Anyone that really wants to hack it will succeed anyway, even with server-side checks, as I've seen it in many flash games.</p>
