title: Immutable game objects
body: <p>I'm trying to wrap my head around F#, and for the most part it's making sense, but people keep saying that every problem can be solved with immutable constructs. But what about objects in a game? They have constantly changing variables (x, y, xspeed, yspeed, score, health etc...)</p>
  
  <p>Lets say I have a player object, defined in C# as:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Player extends GameObject
  {
      private int score = 0;
      private int x = 0;
      private int y = 0;    
      ... more variables
  
      public Player()
      {
  
      }
  
      public void addScore(int amount)
      {
          score += amount;
      }
  
      public void addX(int amount)
      {
          x += amount;
      }
  
      public void addY(int amount)
      {
          y += amount;
      }
  
      ... more methods
  }
  </code></pre>
  
  <p>This code has variables that are inherently there for being just that: "variables." How would this code translate to immutable code?</p>