Added touchend event, modifed mouse down/move/up so that ball is released only when the mouse/touch hasn't moved