getSpriteRotationSpeed()
Purpose
Get a sprites rotation speed
Description
This is the amount that the sprite's rotation angle is changed by when updatesprites is called
Syntax
rotatespeed = getSpriteRotationSpeed( sprite )
rotatespeed = sprite.rotation_speed
Arguments
sprite handle of the created sprite
rotatespeed amount to add to the rotation angle of the sprite at each updatesprites call
Example
image = loadImage( "Untied Games/Enemy small top C", false )
ship = createSprite()
setSpriteImage( ship, image )
lastpos = { gWidth() / 2, gHeight() / 2 }
setSpriteLocation( ship, lastpos )
setSpriteScale( ship, { 10, 10 } )
maxrs = 240 // max rotation speed
accr = 1 // accelaration
loop
clear()
rs = getSpriteRotationSpeed( ship )
if abs( rs ) > maxrs then
accr = -accr
endIf
setSpriteRotationSpeed( ship, rs + accr )
updateSprites()
drawSprites()
update()
repeat
Associated Commands
getSpriteRotation(), setSpriteRotation(), setSpriteRotationSpeed()