moved game logic to script files