My 2 cents...
I assume the starfish crawls in any dirrection. If arm 1 touches the glass a routine hoists him into a vertical possition... ie.. he is now crawling up the glass. If any other arm touches the glass it appears as if it is up against an object it can not climb and starts a rotation. At this point.. it iether keeps rotating till arm 1 touches or.. it appears to change its mind and go in a new dirrection. Same process (except now vertical) when coming down off the glass. Arm 1 touches and he goes on the sand.. any other arm and it rotates, possibly crawling to another direction or.. until arm 1 touches
is it a male starfish?