Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

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()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.