title: Prevent user from changing game values in the browser console
body: <p>Any player can easily cheat on this game by changing the amount of cupcakes through the browser console. I wanted to know if there was a way to prevent the user from doing so. This is also posted on <a href="https://github.com/ray-h-kim/Cupcake___Clicker" rel="nofollow">github</a>.</p>
  
  <pre><code>var numberOfCupcakesDisplay = document.getElementById("numberOfCupcakes");
  var cupcake = document.getElementById("cupcake");
  
  function updateValues() {
      numberOfCupcakesDisplay.innerHTML = amountOfCupcakes.toString();
      //displays number of cupcakes to screen
      document.getElementById("amountOfToasters").innerHTML = amountOfToasters.toString();
      //displays number of toasters to screen
      document.getElementById("toasterButton").innerHTML = "&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp" + Math.round(costOfToasters).toString() + " cc";
      //changes cost of toaster every time it is bought by 110%
  }
  
  cupcake.addEventListener('webkitAnimationEnd', function(e){
      e.preventDefault();
      this.style.webkitAnimationName = '';
  }, false);
  
  function clickCupcake() {
      ++amountOfCupcakes;
      cupcake.style.animation = "shiftCupcake";
      cupcake.style.webkitAnimationName = "shiftCupcake";
  }
  
  updateValues();
  </code></pre>