Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setSpriteAnimation()

Purpose

Animate a sprite

Description

Create a sprite from a tile sheet and animate it.

Syntax

setSpriteAnimation( sprite, startTile, endTile )

setSpriteAnimation( sprite, startTile, endTile, speed )

Arguments

sprite The handle of the sprite

startTile The number of the first tile in the animation sequence (0 based)

endTile The number of the last tile in the animation sequence (0 based)

speed The speed of the animation (default is 10)

Example

image = loadImage( "Untied Games/Enemy A", false )
enemy = createSprite()
setSpriteImage( enemy, image )
setSpriteAnimation( enemy, 0, 4, 20 )
lastpos = { gWidth() / 2, gHeight() / 2 }
setSpriteLocation( enemy, lastpos )
setSpriteScale( enemy, { 8, 8 } )

loop
  clear()
  updateSprites()
  drawSprites()
  update()
repeat

Associated Commands

getSpriteAnimFrame(), getSpriteAnimFrameCount(), getSpriteAnimSpeed(), setSpriteAnimFrame(), setSpriteAnimSpeed()

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.