Polygon motion direction change

What are you trying to achieve?:
I want to change polygon motion direction at specific position.
For example, when polygon x position is [-10+t], it moves right.
If [-10+t] achieve 10deg, it moves Left like polygon x position is set up [10-t].

I should write some code, so I tried to write some codes, but that didn’t work.