Sign in to follow this  
yasdar

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.