Legen Diary
Legen Diary

Reputation: 365

can't load tileset cocos2d

I'm trying Ray Wenderlich's tutorials for making a tile based [game] (http://www.raywenderlich.com/29458/how-to-make-a-tile-based-game-with-cocos2d-2-x)

When I try to load my .tmx file it tells me it can't find the tileset file. I've looked into the problem and found this [solution] (https://iphonedevsdk.vanillaforums.com/forum/iphone-sdk-game-development/81383-cocos2d-and-tiled.html)

Yet when I look into my .tmx file, the file reference is only the filename. The tileset file is in the same folder as the .tmx file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map SYSTEM "http://mapeditor.org/dtd/1.0/map.dtd">
<map version="1.0" orientation="orthogonal" width="50" height="50" tilewidth="32"   tileheight="32">
 <tileset firstgid="1" name="tmw_desert_spacing" tilewidth="32" tileheight="32" spacing="1" margin="1">
  <image source="tmw_desert_spacing.png" width="265" height="199"/>
 </tileset>
  <layer name="Tile Layer 1" width="50" height="50">
   <data encoding="base64" compression="gzip">
    H4sIAAAAAAAAA+3DAQkAAAwEoUvy/WMux0DBVVNVVVVVVVVVVdXnD6vDAUcQJwAA
   </data>
  </layer>
 </map>

Thanks for your help!

Upvotes: 0

Views: 246

Answers (1)

Legen Diary
Legen Diary

Reputation: 365

The problem is a combination of several things. Though I included the file in the path, I still had to add the .png to the copy bundle resources in the Build Phases under project resources. After doing that, I had to change the file path to remove the path. After that it worked

Upvotes: 1

Related Questions