title: Box 2D - Is there a way to Move the Ground b2EdgeShape up
body: <p>I'm working on an iPhone game, and the ground is a long, repeating rectangular sprite object that extends about 30 pixels above the bottom of the screen. I'm trying to align my ground edge shape 30 pixels so it when the player sprite lands on the ground from a jump, he will land on top of ground image. When I tried adding the following code, it didn't work:</p>
  
  <pre><code>b2BodyDef groundBodyDef;
  groundBodyDef.position.Set(0, 30/PTM_RATIO);
  
  b2Body *groundBody=world-&gt;CreateBody(&amp;groundBodyDef);
  
  b2EdgeShape groundLine;
  groundLine.Set(b2Vec2(0, 30/PTM_RATIO), b2Vec2(screenSize.width/PTM_RATIO, 30/PTM_RATIO));
  groundBody-&gt;CreateFixture(&amp;groundLine, 0);
  </code></pre>
  
  <p>I realize I could probably use a rectangle shape for the ground, but since my player sprite is only colliding with the top of the image, I would rather get away with an edge shape.</p>