Made the AI gameLoop

This is completely based on the normal gameLoop