Game logic ported onto iOS