"Rotate sprite" uses a number between 0 and 359. All you need is a variable to store the sprites current rotation. You can use numbers beyond that range and it automatically figures out what the angle is... but it's probably best to limit the range in code.
` Create the sprite
a$="Rotate Sprite"
text 0,0,a$
get image 1,0,0,text width(a$),text height(a$),1
sprite 1,320,240,1
` Offset the sprite so it rotates in the center
offset sprite 1,text width(a$)/2,text height(a$)/2
` SpriteAngle is a number between 0 and 359
SpriteAngle=0
do
if upkey() then move sprite 1,1
if downkey() then move sprite 1,-1
` Add one to SpriteAngle and rotate sprite
if leftkey()
inc SpriteAngle,1
if SpriteAngle>359 then SpriteAngle=0
rotate sprite 1,SpriteAngle
endif
` Subtract one from SpriteAngle and rotate sprite
if rightkey()
dec SpriteAngle,1
if SpriteAngle<0 then SpriteAngle=359
rotate sprite 1,SpriteAngle
endif
text 0,0,str$(SpriteAngle)
loop