0

スプライトキット ゲーム用に JS TileMap をブリッジしました。プロジェクトに tmx ファイルを配置し、JSTileMap オブジェクトを初期化しようとしています

let map = JSTileMap(fileNamed: "level 1-1.tmx")

このエラーが発生します

2014-11-15 17:43:03.428 MyGame[5726:1901295] * キャッチされない例外 'NSInvalidArgumentException' によるアプリの終了、理由: '* -[NSKeyedUnarchiver initForReadingWithData:]: 理解できないアーカイブ (0x3c、0x3f、0x78、0x6d、0x6c , 0x20, 0x76, 0x65)' *** 最初のスロー コール スタック: (

ファイルが見つからない可能性がありますか?ファイル名を存在しないものに変更すると、同じエラーが発生することに気付きました..

これが私のtmxファイルの内容です

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="1000" height="800" tilewidth="1" tileheight="1">
 <tileset firstgid="1" name="enemies" tilewidth="80" tileheight="75">
  <tile id="0">
   <properties>
    <property name="name" value="EnemyA"/>
   </properties>
   <image width="66" height="75" source="../Atlases/iPhone/enemyA.atlas/enemy@2x.png"/>
  </tile>
  <tile id="1">
   <image width="65" height="67" source="../Atlases/iPhone/enemyB.atlas/enemy@2x.png"/>
  </tile>
  <tile id="2">
   <properties>
    <property name="name" value="EnemyC"/>
   </properties>
   <image width="60" height="60" source="../Atlases/iPhone/enemyC.atlas/enemy@2x.png"/>
  </tile>
  <tile id="3">
   <image width="61" height="65" source="../Atlases/iPhone/enemyD.atlas/enemy@2x.png"/>
  </tile>
  <tile id="4">
   <image width="74" height="58" source="../Atlases/iPhone/enemyE.atlas/enemy@2x.png"/>
  </tile>
  <tile id="5">
   <properties>
    <property name="name" value="EnemyF"/>
   </properties>
   <image width="80" height="73" source="../Atlases/iPhone/enemyF.atlas/enemy@2x.png"/>
  </tile>
 </tileset>
 <objectgroup color="#000000" name="Object Layer 1">
  <object name="EnemyA" type="enemy" gid="1" x="137" y="489"/>
  <object name="EnemyC" type="enemy" gid="6" x="468" y="454"/>
  <object name="EnemyB" type="enemy" gid="3" x="310" y="321"/>
 </objectgroup>
</map>

私はちょうどにそれを編集しようとしましたが、それでもそのエラーがスローされます。libz.dylib を含めるようにしています

私は何を間違っていますか?

4

2 に答える 2

1

間違った初期化方法を使用していました

そのはず

let map = JSTileMap(named: "level 1-1.tmx")
于 2014-11-16T02:28:39.057 に答える