Rotating sprites

How might it be done??


-- Rotating Sprites

-- Use this function to perform your initial setup
function setup()
    spritex=WIDTH/2 --horizontal screen position of the sprite
    spritey=HEIGHT/2 --vertical screen position of the sprite
    spriteangle=0 --rotation of the sprite in degrees
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color
    background(40, 40, 50)
    
    pushMatrix()
    translate(spritex,spritey)
    rotate(spriteangle)
    sprite("Planet Cute:Character Boy",0,0)
    popMatrix()
    spriteangle=spriteangle+1 --rotate the sprite clockwise - change the value to spped up and slow down, make negative to spin anticlockwise
end


Thank you!