Ported game logic to new environment