added direction to playAnimation