Moving shape with rotate

[Mod edit: please avoid sharing full code solutions]