reconfiged ai for both player and enemy