So here is a slightly different example.
* The rotation is driven by pressing a key.
* It now lets you use any value for the rotation speed.
* I moved the variables into the sprite so we can have multiple rolling squares.
* Lastly, it rounds the angle and position to the nearest integer when a 90 degree rotation is done. Do to rounding errors the position and angle wouldn't be slightly off a perfect value.
dropbox.com/s/4vfgdw3mzx6lwkb/box_roll2.capx