yasdar Posted August 15, 2014 Share Posted August 15, 2014 Hi,I'm trying to add a very little animation ( flying bird) to the background "tilesprite", the bird and the background have to move together.any idea how to do this ?Thank you. Link to comment Share on other sites More sharing options...
lewster32 Posted August 15, 2014 Share Posted August 15, 2014 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. yasdar 1 Link to comment Share on other sites More sharing options...
yasdar Posted August 19, 2014 Author Share Posted August 19, 2014 Thank you for help.work fine . Link to comment Share on other sites More sharing options...
Recommended Posts