Jump to content

how to add an animation to a tilesprite


Recommended Posts

I'd just create a normal animated sprite and in the update loop just keep its position updated to match the TileSprite, as animating the entire TileSprite just for one small part of it would be enormously inefficient.

function update() {  this.bird.position.x = background.tilePosition.x + originalPositionX;  this.bird.position.y = background.tilePosition.y + originalPositionY;}

Where originalPositionX and Y are the offsets where you want your bird to appear in relation to the TileMap.


If the TileSprite loops, then just have something in place so that if it moves off the edge of the screen it's repositioned on the other side.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...