{"id":421,"date":"2012-11-08T16:41:41","date_gmt":"2012-11-08T16:41:41","guid":{"rendered":"http:\/\/www.blogs.abeazam.com\/dev\/?p=421"},"modified":"2012-11-13T11:19:57","modified_gmt":"2012-11-13T11:19:57","slug":"using-levelhelper-without-box2d-for-cocos2d-x","status":"publish","type":"post","link":"http:\/\/www.blogs.abeazam.com\/dev\/2012\/11\/using-levelhelper-without-box2d-for-cocos2d-x\/","title":{"rendered":"Using LevelHelper without Box2d for Cocos2d-X"},"content":{"rendered":"<p>I have been trying out <a href=\"http:\/\/www.gamedevhelper.com\/products\/levelhelper\/\">LevelHelper<\/a> recently and it has been very useful when making games that have a fair bit of physics.<\/p>\n<p>I was looking at making a really simple game that did not require physics. Thats where LevelHelper seemed to fall over. Since the editor generates code for you and that code has reference to Box2D.<\/p>\n<p>Fear not for all is not lost, you can still use LevelHelper without implementing the physics. You still need use the Cocos2D-X with Box2D template in xCode. You just don&#8217;t attach the physics properties. <\/p>\n<p>So follow the <a href=\"http:\/\/www.gamedevhelper.com\/documentation\/documentation.html\">tutorials on the LevelHelper<\/a> site. When you get to the bellow line of code in the second video:<\/p>\n<p>[cpp]<br \/>\n\/\/attaches the physics properties and the sprites to the view.<br \/>\nloader->addObjectsToWorld(world, this);[\/cpp]<\/p>\n<p>The first parameter &#8220;world&#8221; is used to attach the physics properties. The second parameter &#8220;this&#8221; is what all the image assets in LevelHelper level are attached to. All you need to do is change the above line to:<\/p>\n<p>[cpp]<br \/>\n\/\/only attaches the sprites to the view.<br \/>\nloader->addObjectsToWorld(NULL, this);[\/cpp]<\/p>\n<p>Now just ignore any code to do with physics and Box2D.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been trying out LevelHelper recently and it has been very useful when making games that have a fair bit of physics. I was looking at making a really simple game that did not require physics. Thats where LevelHelper seemed to fall over. Since the editor generates code for you and that code has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[82,83,84,17,18,25,26,28,30,53],"tags":[86,87],"_links":{"self":[{"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/posts\/421"}],"collection":[{"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/comments?post=421"}],"version-history":[{"count":6,"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":430,"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/posts\/421\/revisions\/430"}],"wp:attachment":[{"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/media?parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/categories?post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.blogs.abeazam.com\/dev\/wp-json\/wp\/v2\/tags?post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}