Update sprite’s rotation when the start direction is set from the scripting API.

Fixes #287.