<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Make a Tile-Based Game with Cocos2D</title>
	<atom:link href="http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d/feed" rel="self" type="application/rss+xml" />
	<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d</link>
	<description>Tutorials for iPhone / iOS Developers and Gamers</description>
	<lastBuildDate>Sun, 29 Jan 2012 06:07:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Jeff</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7818</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Wed, 15 Dec 2010 21:23:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7818</guid>
		<description>Anyone know of a good solution to achieve smooth tiles such as curves, rather than rectangles?  Thanks.</description>
		<content:encoded><![CDATA[<p>Anyone know of a good solution to achieve smooth tiles such as curves, rather than rectangles?  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Wenderlich</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7660</link>
		<dc:creator>Ray Wenderlich</dc:creator>
		<pubDate>Tue, 14 Dec 2010 01:45:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7660</guid>
		<description>@Marc-Andre: Wow that was extremely kind of you to help out Drew by compiling/running his code and everything.  Thanks so much!

@Drew: Thanks for posting here what the problem was in case others run into the same issue!</description>
		<content:encoded><![CDATA[<p>@Marc-Andre: Wow that was extremely kind of you to help out Drew by compiling/running his code and everything.  Thanks so much!</p>
<p>@Drew: Thanks for posting here what the problem was in case others run into the same issue!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How To Drag and Drop Sprites with Cocos2D &#124; Ray Wenderlich</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7653</link>
		<dc:creator>How To Drag and Drop Sprites with Cocos2D &#124; Ray Wenderlich</dc:creator>
		<pubDate>Tue, 14 Dec 2010 01:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7653</guid>
		<description>[...] If you are curious as to the advantages of this new method over the old method, check out the How To Make a Tile Based Game with Cocos2D Tutorial for more [...]</description>
		<content:encoded><![CDATA[<p>[...] If you are curious as to the advantages of this new method over the old method, check out the How To Make a Tile Based Game with Cocos2D Tutorial for more [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7490</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Sat, 11 Dec 2010 19:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7490</guid>
		<description>Yeah, that worked beautifully. It loaded up just fine, thank you very much Marc.

So upon further investigation I have discovered EXACTLY what my issue was. The issue is that upon importing a custom .tmx file, its image source points to the location on the computer and not in the local resources file. If the user then clicks on the newly imported .tmx file (now in your xcode resources folder) you need to redirect the image source from iPhone/Tiled/examples/tmw_desert_spacing.jpg
to just the name of the .jpg in your local resources folder, in this case &quot;twm_desert_spacing.jpg&quot;

I&#039;ll continue to play around with it and report my findings. Hopefully this will prevent someone else from getting lost.</description>
		<content:encoded><![CDATA[<p>Yeah, that worked beautifully. It loaded up just fine, thank you very much Marc.</p>
<p>So upon further investigation I have discovered EXACTLY what my issue was. The issue is that upon importing a custom .tmx file, its image source points to the location on the computer and not in the local resources file. If the user then clicks on the newly imported .tmx file (now in your xcode resources folder) you need to redirect the image source from iPhone/Tiled/examples/tmw_desert_spacing.jpg<br />
to just the name of the .jpg in your local resources folder, in this case &#8220;twm_desert_spacing.jpg&#8221;</p>
<p>I&#8217;ll continue to play around with it and report my findings. Hopefully this will prevent someone else from getting lost.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc-André Weibezahn</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7477</link>
		<dc:creator>Marc-André Weibezahn</dc:creator>
		<pubDate>Sat, 11 Dec 2010 12:44:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7477</guid>
		<description>Oh and general advice: if you have the chance, test on a real device, both console and debugger work a lot better there =)</description>
		<content:encoded><![CDATA[<p>Oh and general advice: if you have the chance, test on a real device, both console and debugger work a lot better there =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc-André Weibezahn</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7476</link>
		<dc:creator>Marc-André Weibezahn</dc:creator>
		<pubDate>Sat, 11 Dec 2010 12:27:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7476</guid>
		<description>@Drew: I pasted your code in a project but I used the map from this tutorial – everything works fine. See for yourself:
http://www.weibezahn.com/Untitled.zip

So the problem could be in your map or may be a missing ressource (maybe the path to the tile image in the tmx?).</description>
		<content:encoded><![CDATA[<p>@Drew: I pasted your code in a project but I used the map from this tutorial – everything works fine. See for yourself:<br />
<a href="http://www.weibezahn.com/Untitled.zip" rel="nofollow">http://www.weibezahn.com/Untitled.zip</a></p>
<p>So the problem could be in your map or may be a missing ressource (maybe the path to the tile image in the tmx?).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d#comment-7435</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Fri, 10 Dec 2010 21:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1163#comment-7435</guid>
		<description>Thank you Ray, I am really looking forward to getting this program working. It&#039;s been fun thus far.

Perhaps I am coding my project incorrectly and hopefully someone can help me out, I&#039;m really excited to get into this.

My background in programming is somewhat limited, I mainly program using C++ and ActionScripting within flash.

Everytime I try to &quot;build and run&quot; my program the iPhone simulator pops up, loads the Cocos2d logo, flips the phone sideways and then crashes to the homescreen. Looking at my xcode terminal I see a &quot;Debugging terminated.&quot; at the bottom... but no other mention to coding issues.

Would someone be as to so kind to copy and past their .h and .m files for this or at least tell me what I have done wrong with mine... maybe I am putting the code in the wrong places?

My .h file is as follows:
//*************************************
/
//  HelloWorldLayer.h
//  TileGame
//
//  Created by Drew on 12/10/10.
//  Copyright xxxxx 2010. All rights reserved.
//


// When you import this file, you import all the cocos2d classes
#import &quot;cocos2d.h&quot;

// HelloWorld Layer
@interface HelloWorld : CCLayer
{
	CCTMXTiledMap *_tileMap;
	CCTMXLayer *_background;
}

@property (nonatomic, retain) CCTMXTiledMap *tileMap;
@property (nonatomic, retain) CCTMXLayer *background;

// returns a Scene that contains the HelloWorld as the only child
+(id) scene;

@end
//**********************************

MY .m file is as follows:
//**********************************

//
//  HelloWorldLayer.m
//  TileGame
//
//  Created by Drew on 12/10/10.
//  Copyright xxxxx 2010. All rights reserved.
//

// Import the interfaces
#import &quot;HelloWorldScene.h&quot;

// HelloWorld implementation
@implementation HelloWorld
@synthesize tileMap = _tileMap;
@synthesize background = _background;

+(id) scene
{
	// &#039;scene&#039; is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// &#039;layer&#039; is an autorelease object.
	HelloWorld *layer = [HelloWorld node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

// on &quot;init&quot; you need to initialize your instance
-(id) init
{
    if( (self=[super init] )) {
		
        self.tileMap = [CCTMXTiledMap tiledMapWithTMXFile:@&quot;tilemap.tmx&quot;];
        self.background = [_tileMap layerNamed:@&quot;Background&quot;];
		
        [self addChild:_tileMap z:-1];
		
    }
    return self;
}

// on &quot;dealloc&quot; you need to release all your retained objects
- (void) dealloc
{
	self.tileMap = nil;
	self.background = nil;
	[super dealloc];
}
@end
//***********************************

How I ran it:
Xcode 3.2.3
Simulator 4.0 &#124; Debug
Base SDK: iPhone device 4.0

All resources from the download have been imported to the resources folder.
My Tiled creation is titled &quot;tilemap.tmx&quot; exactly what the code asks for.
I have tried to clean all targets as well as &quot;Reset Content and Settings...&quot; within the iphone simulator... still no luck

There are no errors in the build and no issues, it just says &quot;Debugging terminated.&quot;

Please help.

Thank you,
Drew</description>
		<content:encoded><![CDATA[<p>Thank you Ray, I am really looking forward to getting this program working. It&#8217;s been fun thus far.</p>
<p>Perhaps I am coding my project incorrectly and hopefully someone can help me out, I&#8217;m really excited to get into this.</p>
<p>My background in programming is somewhat limited, I mainly program using C++ and ActionScripting within flash.</p>
<p>Everytime I try to &#8220;build and run&#8221; my program the iPhone simulator pops up, loads the Cocos2d logo, flips the phone sideways and then crashes to the homescreen. Looking at my xcode terminal I see a &#8220;Debugging terminated.&#8221; at the bottom&#8230; but no other mention to coding issues.</p>
<p>Would someone be as to so kind to copy and past their .h and .m files for this or at least tell me what I have done wrong with mine&#8230; maybe I am putting the code in the wrong places?</p>
<p>My .h file is as follows:<br />
//*************************************<br />
/<br />
//  HelloWorldLayer.h<br />
//  TileGame<br />
//<br />
//  Created by Drew on 12/10/10.<br />
//  Copyright xxxxx 2010. All rights reserved.<br />
//</p>
<p>// When you import this file, you import all the cocos2d classes<br />
#import &#8220;cocos2d.h&#8221;</p>
<p>// HelloWorld Layer<br />
@interface HelloWorld : CCLayer<br />
{<br />
	CCTMXTiledMap *_tileMap;<br />
	CCTMXLayer *_background;<br />
}</p>
<p>@property (nonatomic, retain) CCTMXTiledMap *tileMap;<br />
@property (nonatomic, retain) CCTMXLayer *background;</p>
<p>// returns a Scene that contains the HelloWorld as the only child<br />
+(id) scene;</p>
<p>@end<br />
//**********************************</p>
<p>MY .m file is as follows:<br />
//**********************************</p>
<p>//<br />
//  HelloWorldLayer.m<br />
//  TileGame<br />
//<br />
//  Created by Drew on 12/10/10.<br />
//  Copyright xxxxx 2010. All rights reserved.<br />
//</p>
<p>// Import the interfaces<br />
#import &#8220;HelloWorldScene.h&#8221;</p>
<p>// HelloWorld implementation<br />
@implementation HelloWorld<br />
@synthesize tileMap = _tileMap;<br />
@synthesize background = _background;</p>
<p>+(id) scene<br />
{<br />
	// &#8216;scene&#8217; is an autorelease object.<br />
	CCScene *scene = [CCScene node];</p>
<p>	// &#8216;layer&#8217; is an autorelease object.<br />
	HelloWorld *layer = [HelloWorld node];</p>
<p>	// add layer as a child to scene<br />
	[scene addChild: layer];</p>
<p>	// return the scene<br />
	return scene;<br />
}</p>
<p>// on &#8220;init&#8221; you need to initialize your instance<br />
-(id) init<br />
{<br />
    if( (self=[super init] )) {</p>
<p>        self.tileMap = [CCTMXTiledMap tiledMapWithTMXFile:@"tilemap.tmx"];<br />
        self.background = [_tileMap layerNamed:@"Background"];</p>
<p>        [self addChild:_tileMap z:-1];</p>
<p>    }<br />
    return self;<br />
}</p>
<p>// on &#8220;dealloc&#8221; you need to release all your retained objects<br />
- (void) dealloc<br />
{<br />
	self.tileMap = nil;<br />
	self.background = nil;<br />
	[super dealloc];<br />
}<br />
@end<br />
//***********************************</p>
<p>How I ran it:<br />
Xcode 3.2.3<br />
Simulator 4.0 | Debug<br />
Base SDK: iPhone device 4.0</p>
<p>All resources from the download have been imported to the resources folder.<br />
My Tiled creation is titled &#8220;tilemap.tmx&#8221; exactly what the code asks for.<br />
I have tried to clean all targets as well as &#8220;Reset Content and Settings&#8230;&#8221; within the iphone simulator&#8230; still no luck</p>
<p>There are no errors in the build and no issues, it just says &#8220;Debugging terminated.&#8221;</p>
<p>Please help.</p>
<p>Thank you,<br />
Drew</p>
]]></content:encoded>
	</item>
</channel>
</rss>

