Copied from Windows
Changed game logic