1

I have searched around the interent and this question has been asked many times before, but either I could not understand the answer or it led to a dead end. Right now I have a standard TMX tile map set up in my cocos2d game that I made in Tiled.

One of the tiles in the map is a Gate. The tile of the gate shows an image of just the gate closed. How would I make it that when the player touches a button the gate opens through animation.

I have all the required files for it. For example: Gate.png(Sprite sheet of every frame of the Gate), Gate_Open.plist(Animation Plist), Gate.plist(File to decode the sprite sheet).

If I have a blank scene I can get the gate to animate on its own, but my question is: What is the best way to animate a single tile of a TMX Map? Thanks for you time.

-Marc

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
  • 1
    is the gate animation in the tileset (based on your files I suppose not)? To change tiles use setTileGID: otherwise just animate it as a regular sprite – CodeSmile May 25 '13 at 20:18
  • 1
    also look at http://stackoverflow.com/questions/13763769/how-to-create-single-tile-map-for-universaliphone-ipad-for-cocos2d – Rachel Gallen May 25 '13 at 20:23
  • 1
    Note that as of sometime in 2014, Tiled now supports animated tiles, so you don't need to implement them through any sort of hack as used to be required. https://github.com/bjorn/tiled/issues/57 – Josh1billion Nov 21 '14 at 05:17

1 Answers1

0

It might just be a matter of either changing your anchor point for the gate sprite or setting an offset.

Tone
  • 322
  • 1
  • 3
  • 16