Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

getSpriteRotation()

Purpose

Get the rotation angle of a sprite

Description

Get the current rotation angle of a sprite in the default angle units

Syntax

angle = getSpriteRotation( sprite )

angle = sprite.rotation

Arguments

sprite handle of the created sprite

rotation angle in the default units

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 } )
setSpriteRotationSpeed( ship, 60 )

loop
    clear()
    angle = getSpriteRotation( ship )
    if angle > 360 then
        setSpriteRotationSpeed( ship, -60 )
    endIf
    if angle < 0 then
        setSpriteRotationSpeed( ship, 60 )
    endIf
    updateSprites()
    drawSprites()
    update()
repeat

Associated Commands

getSpriteRotationSpeed(), 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.