improved battle flow. split up game functions to multiple .js files