Merged improved AI with code for animations and menu.