<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<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">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: Box2D - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/box2d</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 03:58:09 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/box2d/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>indy2005 on "[Box2D] Fixed Time Step Implementation - Thanks UNAGames"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8922#post-51618</link>
			<pubDate>Sun, 22 Aug 2010 13:35:07 +0000</pubDate>
			<dc:creator>indy2005</dc:creator>
			<guid isPermaLink="false">51618@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I have created a version of this great code from UNAGames (Tapsteroids game) which works in Cocos2D. I simply subclassed CCSprite to create a CCPhysicsSprite which tracks the interpolated / smoothed positions and angles and adjusted the code in a couple of your methods to support it.</p>
<p>Great article!<br />
<a href="http://www.unagames.com/blog/daniele/2010/06/fixed-time-step-implementation-box2d" rel="nofollow">http://www.unagames.com/blog/daniele/2010/06/fixed-time-step-implementation-box2d</a></p>
<p>As a test I reduced the animation interval to 1/10 second, and in the original demo - there is quite a lot of penetration in the blocks before collision kicks in, but in the fixed timestep implementation - with a physics interval of 1/60 but an animation interval of 1/10...the penetration of the blocks seems much reduced....hopefully this is a consequence of a more accurate simulation!!!</p>
<p>Thanks! Happy to share my hacked project / code if its useful.  ALthough I take no credit for the hard stuff, I just did some minor changes so I didn't need to wrap my b2Bodies in PhysicsComponents as in the article.</p>
<p>Regards</p>
<p>i
</p></description>
		</item>
		<item>
			<title>mijator on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143322</link>
			<pubDate>Wed, 08 Feb 2012 21:36:09 +0000</pubDate>
			<dc:creator>mijator</dc:creator>
			<guid isPermaLink="false">143322@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Just wondering if I am right about the priority of z orders and layers...</p>
<p>&#62;&#62;&#62;<br />
That is:</p>
<p>Layer 1 : z:0</p>
<p>CCSprite *a-sprite z:100  // a-sprite is contained within Layer 1 so even though it has an individual z order of 100, it stays within the z:0 layer and all objects (on different layers) are above it if the layer they are on is greater than z:0 (see below)</p>
<p>//it also means I can have 99 more sprite "sub layers" within layer 1 before things start to get confusing</p>
<p>Layer 2 z:1  // everything in this layer is above all of the objects in Layer 1</p>
<p>CCSprite *b-sprite z:100 //i.e., even though they have the same z value, b-sprite is NOT in the same layer as a-sprite because it has been created in layer 2...</p>
<p>&#62;&#62;&#62;<br />
Am I right with the above?
</p></description>
		</item>
		<item>
			<title>sloppyflow on "[Box2dD] need help on shooting"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28959#post-142736</link>
			<pubDate>Sun, 05 Feb 2012 10:57:46 +0000</pubDate>
			<dc:creator>sloppyflow</dc:creator>
			<guid isPermaLink="false">142736@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So i am trying to create a game sort of like angry bird, which requires player to swipe the ball and shoot based on the angle and distance. I found a tutorial based on Flash Box2D <a href="http://www.emanueleferonato.com/2011/10/10/develop-a-flash-game-like-angry-birds-using-box2d/" rel="nofollow">http://www.emanueleferonato.com/2011/10/10/develop-a-flash-game-like-angry-birds-using-box2d/</a></p>
<p>But i have hard time trying to figure out the conversion.</p>
<p>so in my init, i have create my body object.<br />
<pre><code>CCSprite *tail = [CCSprite spriteWithFile:@&#34;Ball.jpg&#34;];
        [self addChild:tail z:1];

        b2BodyDef tailBodyDef;
        tailBodyDef.type = b2_dynamicBody;
        tailBodyDef.position.Set(100/PTM_RATIO, 100/PTM_RATIO);
        tailBodyDef.userData = tail;
        tailBody = world-&#62;CreateBody(&#38;tailBodyDef);

        b2CircleShape circle;
        circle.m_radius = 26.0/PTM_RATIO;

        b2FixtureDef tailShapeDef;
        tailShapeDef.shape = &#38;circle;
        tailShapeDef.density = 1.0f;
        tailShapeDef.friction = 0.2f;
        tailShapeDef.restitution = 0.8f;
        tailBody-&#62;CreateFixture(&#38;tailShapeDef);

		[self schedule: @selector(tick:)];</code></pre>
<p>I have these code on my touch dispatcher.<br />
<pre><code>- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (mouseJoint != nil) return;

    UITouch *myTouch = [touches anyObject];
    CGPoint location = [myTouch locationInView:[myTouch view]];
    location = [[CCDirector sharedDirector] convertToGL:location];
    b2Vec2 locationWorld = b2Vec2(location.x/PTM_RATIO, location.y/PTM_RATIO);

    if (locationWorld.x &#60; tailBody-&#62;GetWorldCenter().x + 50.0/PTM_RATIO)
    {
        b2MouseJointDef md;
        md.bodyA = groundBody;
        md.bodyB = tailBody;
        md.target = locationWorld;
        md.maxForce = 2000;

        mouseJoint = (b2MouseJoint *)world-&#62;CreateJoint(&#38;md);
    }
}

- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (mouseJoint == nil) return;

    UITouch *myTouch = [touches anyObject];
    CGPoint location = [myTouch locationInView:[myTouch view]];
    location = [[CCDirector sharedDirector] convertToGL:location];

    float distanceX = location.x-170;
    float distanceY =location.y-270;
    if (distanceX*distanceX+distanceY*distanceY&#62;10000) {
        CGFloat angle = atan2f(distanceY,distanceX);
        location.x=170+100*cosf(angle);
        location.y=270+100*sinf(angle);
    }
    b2Vec2 locationWorld = b2Vec2(location.x/PTM_RATIO, location.y/PTM_RATIO);
    mouseJoint-&#62;SetTarget(locationWorld);
}

- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (mouseJoint != nil) return;

    UITouch *myTouch = [touches anyObject];
    CGPoint location = [myTouch locationInView:[myTouch view]];
    location = [[CCDirector sharedDirector] convertToGL:location];
    b2Vec2 locationWorld = b2Vec2(location.x/PTM_RATIO, location.y/PTM_RATIO);

    float distanceX = location.x-170;
    float distanceY =location.y-270;
    float distance = sqrtf(distanceX*distanceX+distanceY*distanceY);
    CGFloat angle = atan2f(distanceY,distanceX);

    // Apply an impulse to the body, using the angle
    tailBody-&#62;ApplyLinearImpulse(b2Vec2(-distance*cosf(angle)/4,-distance*sinf(angle)/4), tailBody-&#62;GetPosition());

    if (mouseJoint) {
        world-&#62;DestroyJoint(mouseJoint);
        mouseJoint = NULL;
    }

}</code></pre>
<p>My problem is i couldn't get it to shoot, i was able to drag the body object around, but when i release my finger. the object stays there instead of shoot itself out.<br />
It'll be great if some of you could help me with this!
</p></description>
		</item>
		<item>
			<title>davidthecoder on "Box2d setupDebugDraw?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21311#post-118531</link>
			<pubDate>Wed, 28 Sep 2011 04:33:10 +0000</pubDate>
			<dc:creator>davidthecoder</dc:creator>
			<guid isPermaLink="false">118531@http://www.cocos2d-iphone.org/forum/</guid>
			<description><pre><code>- (void)setupDebugDraw {
    debugDraw = new GLESDebugDraw(PTM_RATIO *[[CCDirector sharedDirector] contentScaleFactor]);
    world-&#62;SetDebugDraw(debugDraw);
    debugDraw-&#62;SetFlags(b2DebugDraw::e_shapeBit);
}</code></pre>
<p>For Line of Code:  debugDraw = new GLESDebugDraw(PTM_RATIO *[[CCDirector sharedDirector] contentScaleFactor]);<br />
ERROR:Cannot allocate an object of abstract type 'GLESDebugDraw'</p>
<p>I just updated my box2d to the latest version here: <a href="http://code.google.com/p/box2d/downloads/list" rel="nofollow">http://code.google.com/p/box2d/downloads/list</a></p>
<p>Can anybody please tell me what I'm doing wrong?
</p></description>
		</item>
		<item>
			<title>kbaren on "Complex shape and Prismatic Joint"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29011#post-143006</link>
			<pubDate>Tue, 07 Feb 2012 09:41:16 +0000</pubDate>
			<dc:creator>kbaren</dc:creator>
			<guid isPermaLink="false">143006@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a dynamic body created by polygon shape with 15 edges, when i try to create a prismatic joint , for body movement restriction on x axis it does not work(i can drag it in whole screen) but when i change complex shape to simple rectangle shape it works fine, and after when i create complex shape and inside it rectangle shape another dynamic (not all bodies ) bodies collides only with rectangle   what i do wrong? is there problem with body mass center or something else?
</p></description>
		</item>
		<item>
			<title>embero on "[wip] endless runner w/ box2d"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28997#post-142941</link>
			<pubDate>Mon, 06 Feb 2012 21:47:30 +0000</pubDate>
			<dc:creator>embero</dc:creator>
			<guid isPermaLink="false">142941@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Just started to develop my second iOS game with Cocos2D and Box2D for the first time. It took some while to get Box2D running and to understand the basic principles. I wrote a first prototype for my upcoming game and got the procedural terrain working. Technically the terrains is just one b2Body with a bunch of b2Fixtures. These fixtures are added and removed in realtime as needed. </p>
<p>Anyway here is a video which shows the terrain generation.<br />
<a href="http://www.youtube.com/watch?v=QjlkoQiE8-8" rel="nofollow">http://www.youtube.com/watch?v=QjlkoQiE8-8</a>
</p></description>
		</item>
		<item>
			<title>MandarX on "disabling temporarily autorotation"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28989#post-142889</link>
			<pubDate>Mon, 06 Feb 2012 17:45:51 +0000</pubDate>
			<dc:creator>MandarX</dc:creator>
			<guid isPermaLink="false">142889@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>Is there a way to tell CCDirector to disable temporarily autorotation?</p>
<p>I tried to comment some lines in <em>shouldAutorotateToInterfaceOrientation</em> and <em>willRotateToInterfaceOrientation</em> functions<br />
and I disabled it but Box2D doesn't work anymore!</p>
<p>MandarX
</p></description>
		</item>
		<item>
			<title>x0661t on "[Box2D] removing ground body"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28962#post-142761</link>
			<pubDate>Sun, 05 Feb 2012 18:49:14 +0000</pubDate>
			<dc:creator>x0661t</dc:creator>
			<guid isPermaLink="false">142761@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello, I have a CCNode object that has ground body inside it, when i'm removing CCNode object the body still exists, what should I do with such problem? The answer can be like: you should remove ground body on dealloc, but if I'll have 5 to 10 more bodies at this CCNode object, I have to remove them at dealloc method?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>MandarX on "[Box2D] Inertia"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28924#post-142586</link>
			<pubDate>Fri, 03 Feb 2012 21:57:15 +0000</pubDate>
			<dc:creator>MandarX</dc:creator>
			<guid isPermaLink="false">142586@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>still learning Box2D :)</p>
<p>Does the inertia of a body depend upon velocity and friction?</p>
<p>is there a way to handle it?</p>
<p>thanks</p>
<p>MandarX
</p></description>
		</item>
		<item>
			<title>siavash82 on "[Box2D] hovercar suspension rotation"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28908#post-142476</link>
			<pubDate>Fri, 03 Feb 2012 09:44:08 +0000</pubDate>
			<dc:creator>siavash82</dc:creator>
			<guid isPermaLink="false">142476@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is it possible to achieve the same effect but with rotation enabled. I'm thinking use 2 more ray casts on 45 degree angles at the front and back but am unsure how I can use it to rotate the body accordingly. So when going over terrain the body rotates in the same way it would if it was a body sliding across the terrain.</p>
<p><a href="http://www.iforce2d.net/b2dtut/suspension" rel="nofollow">http://www.iforce2d.net/b2dtut/suspension</a>
</p></description>
		</item>
		<item>
			<title>DifferentSparks on "Change scenes and flickering"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28944#post-142691</link>
			<pubDate>Sat, 04 Feb 2012 21:08:52 +0000</pubDate>
			<dc:creator>DifferentSparks</dc:creator>
			<guid isPermaLink="false">142691@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Well, i've 2 scenes, GameOverScene and GamePlayScene. Both of them, have some layers like children (bg,ui ecc).<br />
When my player dies, i just do </p>
<pre><code>[[CCDirector sharedDirector] replaceScene :
             [CCTransitionFade transitionWithDuration : 2.0f
                                                scene : [GameOverScene node]]];</code></pre>
<p>and when the user touches the GameOverLayer</p>
<pre><code>[[CCDirector sharedDirector] replaceScene :
     [CCTransitionFade transitionWithDuration : 1.5f
                                        scene : [GamePlayScene node]]];</code></pre>
<p>Everything is ok, but sometimes, when i come back to the GamePlayScene, all my sprites(with box2d body) are flickering. this happens often if i have some music on the iPhone.</p>
<p>Should i do something for release the old scenes? Can be this the problem?</p>
<p>Currently i have all my GameObjects(CCSprite+Box2d body) in CCMutableArrays , so in the GamePlayerLayer's(GamePlayScene's child) dealloc method i just do</p>
<pre><code>[gameObjectArray release];</code></pre>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>MandarX on "[Box2D] How to know when the shape hits the edges"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28887#post-142383</link>
			<pubDate>Thu, 02 Feb 2012 20:30:29 +0000</pubDate>
			<dc:creator>MandarX</dc:creator>
			<guid isPermaLink="false">142383@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello, </p>
<p>I'm learning Box2D</p>
<p>I put a sprite/shape in my scene/world</p>
<p>how can I know when it hits the edges?</p>
<p>(I have to play an effect)</p>
<p>thanks</p>
<p>MandarX
</p></description>
		</item>
		<item>
			<title>ader42 on "99.5 rc0 ccTouchesBegan issue"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/11186#post-63487</link>
			<pubDate>Wed, 17 Nov 2010 14:01:27 +0000</pubDate>
			<dc:creator>ader42</dc:creator>
			<guid isPermaLink="false">63487@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I don't seem to be able to get ccTouchesXXX working in a CCLayer</p>
<p>although ccTouchXXX works fine.</p>
<p>any ideas?</p>
<pre><code>-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
	NSLog(@&#34; ccTouchesBegan game layer&#34; );
}

-(BOOL) ccTouchBegan:(UITouch*)touch withEvent:(UIEvent *)event
{
	NSLog(@&#34; ccTouchBegan game layer&#34; );
	return YES;
}</code></pre></description>
		</item>
		<item>
			<title>eJayStudios on "Current state of Box2D vs Chipmunk debate?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20201#post-112505</link>
			<pubDate>Thu, 25 Aug 2011 03:47:51 +0000</pubDate>
			<dc:creator>eJayStudios</dc:creator>
			<guid isPermaLink="false">112505@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I'm thinking of making a new game with Cocos2D which will need a 2D physics engine.</p>
<p>Need to decide which one to use, tried browsing but only found old threads on the topic.</p>
<p>What is the current situation with both engines? Did Chipmunk finally caught up with Box2D functionality vise? What about speed?</p>
<p>I know there is SpaceManager wrapper for Chipmunk which sounds cool as I don't want to deal with C directly if possible.</p>
<p>Thanks for any advice!
</p></description>
		</item>
		<item>
			<title>Bill Hollings on "Tell us about your cocos3d app!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19495#post-109053</link>
			<pubDate>Sat, 06 Aug 2011 02:11:20 +0000</pubDate>
			<dc:creator>Bill Hollings</dc:creator>
			<guid isPermaLink="false">109053@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>If you develop an app with <strong>cocos3d</strong>, please tell us about it here!</p>
<p>Add a post to this topic with the app name, a <strong><em>brief</em></strong> description, and links.</p>
<p>If it makes sense, tell us what key <strong>cocos3d</strong> features you've made use of in your app.</p>
<p>And if you are feeling generous, please PM me with a promo code once your app is released. It's always great to see what people are doing with <strong>cocos3d</strong>!</p>
<p>Don't be shy! The more people know about the cool things that are being done with <strong>cocos3d</strong>, the better!</p>
<p>Good luck with your app releases!</p>
<p>...Bill
</p></description>
		</item>
		<item>
			<title>fideliusx on "[Box2D] SetTransform for Body with PrismaticJoint"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28881#post-142326</link>
			<pubDate>Thu, 02 Feb 2012 14:45:14 +0000</pubDate>
			<dc:creator>fideliusx</dc:creator>
			<guid isPermaLink="false">142326@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello guys, hope you're all doing great!</p>
<p>Recently I am stuck at one particular problem. I have a body with several other bodies linked to it using prismatic joint. The problem is, once in several seconds, I need to move the body immediately using SetTransform. When it's moving far away, the joint seems broke, where all smaller bodies are being left over at the old position, then for several seconds the smaller bodies are slowly moving toward to stick back to the main body (I observed this through debug draw). Strangely, revolute joint doesn't seem to produce such problems. Am I missing something here? Is there any way to permanently stick them all to the main body even after being moved with SetTransform?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>antonimasso on "Cocos2D/Box2D endless platformer source code"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28797#post-141900</link>
			<pubDate>Mon, 30 Jan 2012 20:36:47 +0000</pubDate>
			<dc:creator>antonimasso</dc:creator>
			<guid isPermaLink="false">141900@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Good start if you're making an endless platformer. <a href="http://www.amasso.info/?p=284" rel="nofollow">http://www.amasso.info/?p=284</a>
</p></description>
		</item>
		<item>
			<title>Bartos on "Multiple contacts with Box2D Contactlistener"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28527#post-140439</link>
			<pubDate>Fri, 20 Jan 2012 18:46:51 +0000</pubDate>
			<dc:creator>Bartos</dc:creator>
			<guid isPermaLink="false">140439@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, I'm new to both cocos2d and box2d. I'm having some difficulties with implementing some code that plays a sound everytime a ball in my game hits the player. I searched the forum and saw that some people were reporting similar problems, but I haven't really found a solution. Hopefully you guys can help :)</p>
<p>Following the Ray Wenderlicht breakout tutorial part 2, I created a MyContactListener class that implements BeginContact and EndContact and stores the contacts in a public vector. In the tick function of my HelloWorldLayer I iterate through the contacts in this vector and check if the bodies belonging to the contacting fixtures are the ball and the player. For the ball I just used a single circle shape, and for the player i used PhysicsEditor to create a shape (A single fixture with a single polygon, although the plist file suggests that physicsEditor made 1 fixture consisting of multiple polygons).  The problem is that I'm getting multiple contacts every time the ball hits the player, even though the bodies have only 1 fixture. Sometimes this means multiple beginContacts in a row, and then multiple endContacts in a row, and sometimes this means beginContact and endContact alternating multiple times in a row. Do you guys know what the problem is? Could it be related to the mutiple polygons in the fixture of the player body? </p>
<p>Let me know If I am being too vague and you need more info :) </p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>summoner on "[Box2D] HowTo Implement: Shoot an arrow to the..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28867#post-142240</link>
			<pubDate>Thu, 02 Feb 2012 03:46:08 +0000</pubDate>
			<dc:creator>summoner</dc:creator>
			<guid isPermaLink="false">142240@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In cocos2d, there is a method CCJumpBy for handling the sprite movement in air. We move motion code to Box2D as we want my arrows and characters work in physics environment with gravity.</p>
<p>The following materials mentioned how to jump using impulse.<br />
<a href="http://www.iforce2d.net/b2dtut/jumpability" rel="nofollow">http://www.iforce2d.net/b2dtut/jumpability</a></p>
<p>It works but not on projectiles such as<br />
1. An archer to shoot an arrow to specified location and hit the target<br />
2. Characters jump to specified platiform</p>
<p>In the reply posts, iforce2d have mentioned several threads that may help to handle the case<br />
<a href="http://www.iforce2d.net/b2dtut/projected-trajectory" rel="nofollow">http://www.iforce2d.net/b2dtut/projected-trajectory</a><br />
<a href="http://box2d.org/forum/viewtopic.php?f=3&#038;t=7142" rel="nofollow">http://box2d.org/forum/viewtopic.php?f=3&#038;t=7142</a><br />
<a href="http://box2d.org/forum/viewtopic.php?f=3&#038;t=7535" rel="nofollow">http://box2d.org/forum/viewtopic.php?f=3&#038;t=7535</a>
</p></description>
		</item>
		<item>
			<title>Apollo18 on "Problems upgrading cocos2d project to box2d 2.2.1"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28860#post-142215</link>
			<pubDate>Wed, 01 Feb 2012 21:45:30 +0000</pubDate>
			<dc:creator>Apollo18</dc:creator>
			<guid isPermaLink="false">142215@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I simply replaced the box2d folder in my project's library. I then updated the necessary APIs but ended up with 25 Apple Mach-O Linker errors that look something like the following:</p>
<p>Undefined symbols for architecture i386:<br />
  "b2Fixture::Refilter()", referenced from:<br />
      b2Body::SetType(b2BodyType) in b2Body.o<br />
  "b2Fixture::CreateProxies(b2BroadPhase*, b2Transform const&#38;)", referenced from:<br />
      b2Body::CreateFixture(b2FixtureDef const*) in b2Body.o<br />
      b2Body::SetActive(bool) in b2Body.o<br />
  "b2Fixture::DestroyProxies(b2BroadPhase*)", referenced from:<br />
      b2Body::DestroyFixture(b2Fixture*) in b2Body.o<br />
      b2Body::SetActive(bool) in b2Body.o<br />
      b2World::DestroyBody(b2Body*) in b2World.o<br />
  "b2Log(char const*, ...)", referenced from:<br />
      b2Body::Dump() in b2Body.o<br />
      b2World::Dump() in b2World.o</p>
<p>Does anyone know how to fix this? And... this part is a bit abstract–how does one figure out how to fix problems like this without bugging other developers? My searches lead me nowhere.
</p></description>
		</item>
		<item>
			<title>patrickC on "[code] Verlet Rope"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/10411#post-59562</link>
			<pubDate>Sat, 16 Oct 2010 12:47:28 +0000</pubDate>
			<dc:creator>patrickC</dc:creator>
			<guid isPermaLink="false">59562@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey all,<br />
just thought I'd share a small set of classes to draw a Verlet rope that people might find useful.</p>
<p>I created it to use in conjunction with box2d's new b2RopeJoint (which constricts two bodies with a "rope" joint, but obviously has no visual representation), although you can easily use the rope in other scenarios, as long as you feed it a start and end end point at creation and update.</p>
<p>By using VRope you can easily draw a segmented rope updated with a fast Verlet integration</p>
<p>Be aware that the "draw" method simply uses cocos2d's ccDrawLine method, other people might want to find more elegant solutions.<br />
As always, my code is far from optimized but seems to suit my needs, so use at own risk :)</p>
<p>Download: <a href="http://cleverhamstergames.com/VRope-0.1.zip" rel="nofollow">http://cleverhamstergames.com/VRope-0.1.zip</a></p>
<p>USAGE<br />
<code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;VRope.h&#34;</code></p>
<p>pointA and pointB are start and end points of the rope</p>
<p>Create<br />
<code>VRope *verletRope = [[VRope alloc] init:pointA pointB:pointB];</code><br />
Update<br />
<code>[verletRope updateRope:dt pointA:pointA pointB:pointB];</code><br />
Draw<br />
<code>[verletRope draw];</code>
</p></description>
		</item>
		<item>
			<title>fenixlam on "About the Collision Detection in Cocos2D - Android"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28788#post-141841</link>
			<pubDate>Mon, 30 Jan 2012 09:55:16 +0000</pubDate>
			<dc:creator>fenixlam</dc:creator>
			<guid isPermaLink="false">141841@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I think people here hate to see "Collision Detection", because this keyword has been asked frequencily.</p>
<p>I am a noobie in Cocos2D. I don't know how to read the Objective-C code. I begin at the google's Cocos2D - Android source code. Use it to write my first card game. I use Sprite to load the cards, CCRect for Collision Detection. But there is some problem when I detect the cards' clicking method.</p>
<p>I use CCRect to define the card size, use position to get the card location, as same as space shooter - "simple game of Cocos2D". Also implement the CCRect for the clicking area, then check their collision.  But the card is Rectangle with different width and height, not the SQUARE! And my card will be ROTATE and put in the different location in the screen.</p>
<p>So the problem is, when I rotate the card and put them in the screen, waiting user click them and turn back, the rotated card's detection is very strange. Although I can set a variable to record if the card is rotate and change the CCRect's size to fit the image, THAT IS VERY COMPLEX! </p>
<p>Then I am now reviewing the Box2D classes in the source code. Can I use the Box2D's collision detection class in the Cocos2D game? And how to implement it in JAVA?
</p></description>
		</item>
		<item>
			<title>sirhc84 on "Box2D floating dynamic bodies"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28739#post-141629</link>
			<pubDate>Sat, 28 Jan 2012 12:59:24 +0000</pubDate>
			<dc:creator>sirhc84</dc:creator>
			<guid isPermaLink="false">141629@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am trying to float a dynamic body in mid air. This dynamic body is a circle.<br />
First, i set the gravity to -10.<br />
<code><br />
b2Vec2 gravity;<br />
gravity.Set(0.0f, -10.0f);<br />
</code></p>
<p>Next i apply a force (every frame), equal to the gravity*mass of the body.<br />
<code><br />
LHSprite* balloon = [lh spriteWithUniqueName:@"balloon_flying"];<br />
b2Body* b = [balloon body];<br />
b-&#62;ApplyForce( b2Vec2(0.0,10.0*b-&#62;GetMass()),b-&#62;GetPosition() );<br />
</code></p>
<p>When i run this, the body does not float, it falls to the 'ground'. When i apply a larger force (e.g. 17.5*mass) the body rises.<br />
Does anyone have an idea what i must do to let a dynamic body float in mid air?
</p></description>
		</item>
		<item>
			<title>oisincar on "explosions in box2d using raycasts"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28743#post-141654</link>
			<pubDate>Sat, 28 Jan 2012 19:14:44 +0000</pubDate>
			<dc:creator>oisincar</dc:creator>
			<guid isPermaLink="false">141654@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>title says it all...</p>
<p>i used Ray Wenderlich's "RaysCastCallback" code from his tutorial, see here:<br />
<a href="http://www.raywenderlich.com/4653/intermediate-box2d-physics-forces-ray-casts-and-sensors" rel="nofollow">http://www.raywenderlich.com/4653/intermediate-box2d-physics-forces-ray-casts-and-sensors</a></p>
<p>code:<br />
<pre><code>int numOfDirections = 20;
    int maxdistance = 3;

    for (int x = 0; x &#60; numOfDirections; x++) {

        float angle = (360/numOfDirections)*x;
        angle = angle * M_PI / 180;

    RaysCastCallback callback;
    world-&#62;RayCast(&#38;callback ,b2Vec2(ot-&#62;GetPosition().x + sinf(angle)*maxdistance, ot-&#62;GetPosition().y-0.4 + cosf(angle)*maxdistance),b2Vec2(ot-&#62;GetPosition().x,ot-&#62;GetPosition().y-0.4) );

    if (callback.m_fixture) {

            if (callback.m_fixture-&#62;GetBody() != ot) {    

                float angle2;

                b2Body *traj = callback.m_fixture-&#62;GetBody();

                angle2 = atan2f(ot-&#62;GetPosition().y - traj-&#62;GetPosition().y, ot-&#62;GetPosition().x - traj-&#62;GetPosition().x);
                int force = 1;

                float distance = b2Distance(ot-&#62;GetPosition(), traj-&#62;GetPosition())*force;

                distance -= maxdistance;

                traj-&#62;ApplyLinearImpulse(b2Vec2(cosf(angle2) * distance, sinf(angle2) * distance), traj-&#62;GetPosition());

            }

    }

}</code></pre>
<p>"ot" is the name of the b2body which is being exploded</p>
<p>hope this helps someone!<br />
Oisin
</p></description>
		</item>
		<item>
			<title>aasulli1 on "help?image is bigger then the supported 2048x2048 error?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28385#post-139732</link>
			<pubDate>Mon, 16 Jan 2012 19:31:15 +0000</pubDate>
			<dc:creator>aasulli1</dc:creator>
			<guid isPermaLink="false">139732@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i have a question im trying to load the tiled map to the cocos2d scene. do i have to load the png i used to make the tiled map or just the finished tiled map i saved? because my png is 4800x640 to fit all the artwork i needed to make the completed tileD map. because i got an error saying that 4800x640 is bigger then the supported 2048x2048. do i just need to load the tiled layers and not the artwork png. btw i dont have a seperate background the whole level is in tileD.
</p></description>
		</item>
		<item>
			<title>htab on "multiple revolute joints, groundBody questions, and game concept advice needed"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28691#post-141399</link>
			<pubDate>Thu, 26 Jan 2012 18:49:18 +0000</pubDate>
			<dc:creator>htab</dc:creator>
			<guid isPermaLink="false">141399@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, I'm trying to make a game where the player controls a viking ship with two oars on the left and right edges of the landscape screen. I'm trying to mount them on either side of the screen and keep them fixed while the boat that they control is free to roam within the playable area, defined by the groundBody. </p>
<p>When I run this on my iPod the left joint does not position itself correctly.</p>
<p>I have them pinned to the groundBody, but I plan on implementing camera zoom based on boat speed, so I'm thinking that groundBody would not be the right thing to use because it would need to scale with the zoom. Can someone offer advice for using box2d physics for the controls in a game as I've described?</p>
<p>Here's my code for the oars, in my init method:</p>
<p><code><br />
b2BodyDef groundBodyDef;<br />
        groundBodyDef.position.Set(0, 0); // bottom-left corner</p>
<p>        groundBody = world-&#62;CreateBody(&#38;groundBodyDef);</p>
<p>        // Define the ground box shape.<br />
        b2EdgeShape groundBox;		</p>
<p>        // bottom</p>
<p>        groundBox.Set(b2Vec2(0,0), b2Vec2(s.width/PTM_RATIO,0));<br />
        groundBody-&#62;CreateFixture(&#38;groundBox,0);</p>
<p>        // top<br />
        groundBox.Set(b2Vec2(0,s.height/PTM_RATIO), b2Vec2(s.width/PTM_RATIO,s.height/PTM_RATIO));<br />
        groundBody-&#62;CreateFixture(&#38;groundBox,0);</p>
<p>        // left<br />
        groundBox.Set(b2Vec2(0,s.height/PTM_RATIO), b2Vec2(0,0));<br />
        groundBody-&#62;CreateFixture(&#38;groundBox,0);</p>
<p>        // right<br />
        groundBox.Set(b2Vec2(s.width/PTM_RATIO,s.height/PTM_RATIO), b2Vec2(s.width/PTM_RATIO,0));<br />
        groundBody-&#62;CreateFixture(&#38;groundBox,0);</p>
<p>        //CCSprite *arm = [CCSprite spriteWithFile:@"leftcontrol.png"];<br />
        //[self addChild:arm z:1];</p>
<p>        //left oar</p>
<p>        b2BodyDef leftBodyDef;<br />
        leftBodyDef.type = b2_dynamicBody;<br />
        leftBodyDef.linearDamping = 0;<br />
        leftBodyDef.angularDamping = 0;<br />
        leftBodyDef.position.Set(0, 120.0f/PTM_RATIO);<br />
        leftBody = world-&#62;CreateBody(&#38;leftBodyDef);</p>
<p>        b2PolygonShape leftBox;<br />
        b2FixtureDef leftBoxDef;<br />
        leftBoxDef.shape = &#38;leftBox;<br />
        leftBoxDef.density = 0.3F;<br />
        leftBox.SetAsBox(11.0f/PTM_RATIO, 91.0f/PTM_RATIO);<br />
        leftFixture = leftBody-&#62;CreateFixture(&#38;leftBoxDef);</p>
<p>        //right oar<br />
        b2BodyDef armBodyDef;<br />
        armBodyDef.type = b2_dynamicBody;<br />
        armBodyDef.linearDamping = 0;<br />
        armBodyDef.angularDamping = 0;<br />
        armBodyDef.position.Set(s.width/PTM_RATIO,120.0f/PTM_RATIO);<br />
        //armBodyDef.userData = arm;<br />
        armBody = world-&#62;CreateBody(&#38;armBodyDef);</p>
<p>        b2PolygonShape armBox;<br />
        b2FixtureDef armBoxDef;<br />
        armBoxDef.shape = &#38;armBox;<br />
        armBoxDef.density = 0.3F;<br />
        armBox.SetAsBox(11.0f/PTM_RATIO, 91.0f/PTM_RATIO);<br />
        armFixture = armBody-&#62;CreateFixture(&#38;armBoxDef);</p>
<p>        // Create joints to fix the oars to the walls.<br />
        //<br />
        b2RevoluteJointDef armJointDef;<br />
        armJointDef.Initialize(groundBody, armBody, b2Vec2(s.width/PTM_RATIO, 120.0f/PTM_RATIO));<br />
        armJointDef.enableMotor = true;<br />
        armJointDef.enableLimit = true;<br />
        armJointDef.motorSpeed  = -5;<br />
        armJointDef.lowerAngle  = CC_DEGREES_TO_RADIANS(80);<br />
        armJointDef.upperAngle  = CC_DEGREES_TO_RADIANS(140);<br />
        armJointDef.maxMotorTorque = 250;</p>
<p>        armJoint = (b2RevoluteJoint*)world-&#62;CreateJoint(&#38;armJointDef);</p>
<p>        //left joint<br />
        b2RevoluteJointDef leftJointDef;<br />
        leftJointDef.Initialize(groundBody, leftBody, b2Vec2(0, 120.0f/PTM_RATIO));<br />
        leftJointDef.enableMotor = true;<br />
        leftJointDef.enableLimit = true;<br />
        leftJointDef.motorSpeed = -5;<br />
        leftJointDef.lowerAngle = CC_DEGREES_TO_RADIANS(280);<br />
        leftJointDef.upperAngle = CC_DEGREES_TO_RADIANS(220);<br />
        leftJointDef.maxMotorTorque = 250;</p>
<p>        leftJoint = (b2RevoluteJoint*)world-&#62;CreateJoint(&#38;leftJointDef);<br />
</code>
</p></description>
		</item>
		<item>
			<title>jastanton on "Bitmap Collision vs SVG vs Box2D? What should I use?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28662#post-141209</link>
			<pubDate>Wed, 25 Jan 2012 18:17:30 +0000</pubDate>
			<dc:creator>jastanton</dc:creator>
			<guid isPermaLink="false">141209@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am trying to make a worms or tanks like game in Javascript that I want to be crossbrowser, crossplatform. In the game when the player shoots the ground it creates a crater, now to detect collision should I use Bitmap Collision aka pixel perfect collision, or SVG, or should I use Box2D (all geometry), or a combination of Box2d with pixelperfect... what do you recommend? Can you point me in any direction? </p>
<p>p.s.<br />
the collision is for the projectile as well as the player walking on the landscape.
</p></description>
		</item>
		<item>
			<title>BaDRaN on "Problems with cocos2d v2.0 beta 2"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28610#post-140928</link>
			<pubDate>Mon, 23 Jan 2012 23:22:26 +0000</pubDate>
			<dc:creator>BaDRaN</dc:creator>
			<guid isPermaLink="false">140928@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys,</p>
<p>I updated cocos2d files of my game to 2.0, but i have some problems now. The FPS is really going DOWN !!! Before updating, it was 58 FPS. But now, it's 25 FPS !!! It's really slow :(</p>
<p>Can any one solve this problem, please ? Is it from the AppDelegate or from other files ?</p>
<p>Thanks,<br />
BaDRaN ( sorry for my bad english )
</p></description>
		</item>
		<item>
			<title>davidlxk on "[NEW GAME] Drop Dem"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28341#post-139470</link>
			<pubDate>Sat, 14 Jan 2012 02:01:22 +0000</pubDate>
			<dc:creator>davidlxk</dc:creator>
			<guid isPermaLink="false">139470@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Looking up high above, this little monster only has 1 thing in mind..his new craving for fruits! Help get the fruits to Em, the cute little star of the game in this all-new addictive hand and eye adventure! Combining realistic physics, rich playful visuals and challenging hand and eye coordination gameplay, Drop Dem is one of the most unique and fun games on the App Store.</p>
<p>Drop Dem Highlights</p>
<p>≈ Combines realistic physics with rich and playful visuals for an all-new fun experience<br />
≈ Unique power-ups that enhance the game playing experience<br />
≈ Test your hand and eye coordination skills<br />
≈ Challenge your friends for the highest score you can get on the Facebook Leaderboard<br />
≈ Novel and fun Game Center Achievements for you to accomplish</p>
<p>Drop Dem uses the following:</p>
<p>∞ cocos2D v2.0 beta for game engine<br />
∞ box2D for physics engine</p>
<p>Here are some screenshots of Drop Dem<br />
<img src="http://whitesponge.com/img/screens/ingame0.PNG" /><br />
<img src="http://whitesponge.com/img/screens/ingame1.PNG" /><br />
<img src="http://whitesponge.com/img/screens/ingame2.PNG" /><br />
<img src="http://whitesponge.com/img/screens/ingame3.PNG" /><br />
<img src="http://whitesponge.com/img/screens/ingame5.PNG" /></p>
<p>You should also check out the game trailer for Drop Dem<br />
<a href="http://www.youtube.com/watch?v=4U-Rt-VCBmQ" rel="nofollow">http://www.youtube.com/watch?v=4U-Rt-VCBmQ</a></p>
<p>I would like to thank the community of cocos2D for all the help and passion for making games (positive emotion contagion!). Without you guys/gals I would not have got my first game out.</p>
<p>Drop Dem is available from <a href="http://itunes.apple.com/us/app/drop-dem/id490101113">http://itunes.apple.com/us/app/drop-dem/id490101113</a></p>
<p>If you are interested in getting it, do drop me a PM to get the promotion code for it!</p>
<p>Please write an honest review on the app store if you have tried it because I love the feedback from you guys/gals!</p>
<p>Lastly for more information or for support, please visit <a href="http://www.whitesponge.com">http://www.whitesponge.com</a></p>
<p>Have fun and have a great day!
</p></description>
		</item>
		<item>
			<title>hopihopi on "[GAME] Jaywalk"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28535#post-140508</link>
			<pubDate>Sat, 21 Jan 2012 09:35:50 +0000</pubDate>
			<dc:creator>hopihopi</dc:creator>
			<guid isPermaLink="false">140508@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've just published my second cocos2d game yesterday. It is using Box2D for physics. The game is not meant to be offensive - just a humorous one. There are 24 objectives that unlock 8 new items to the game, including new cars, birds etc.</p>
<p>I have to say that the development using cocos2d is amazingly easy. I'm really thankful for this community and the software. This app was my first universal one and I got the iPad version working without any hassle. I can honestly recommend cocos2d to every developer who thinks about making a 2D game on iPhone.</p>
<p>Some screenshots:<br />
<img src="http://a1.mzstatic.com/us/r1000/073/Purple/bb/db/3d/mzl.asvnmvir.320x480-75.jpg" /><br />
<img src="http://a1.mzstatic.com/us/r1000/079/Purple/f5/a3/a1/mzl.reegqeam.320x480-75.jpg" /><br />
<img src="http://a5.mzstatic.com/us/r1000/069/Purple/de/45/df/mzl.fyuclqat.320x480-75.jpg" /></p>
<p>You can download Jaywalk from iTunes here:<br />
<a href="http://itunes.apple.com/us/app/jaywalk/id492037732?ls=1&#038;mt=8" rel="nofollow">http://itunes.apple.com/us/app/jaywalk/id492037732?ls=1&#038;mt=8</a></p>
<p>I really appreciate all of the help I got from other cocos2d users here. Just send me a PM if you want to have a promo code. Any feedback and comments are also welcome. :)
</p></description>
		</item>

	</channel>
</rss>

