{"id":72,"date":"2013-11-05T17:10:11","date_gmt":"2013-11-05T17:10:11","guid":{"rendered":"http:\/\/www.alexsikora.com\/news\/?p=72"},"modified":"2013-11-05T17:25:07","modified_gmt":"2013-11-05T17:25:07","slug":"snakes-and-ladders-or-really-just-ladders-for-now","status":"publish","type":"post","link":"http:\/\/alexsikora.com\/news\/2013\/11\/05\/snakes-and-ladders-or-really-just-ladders-for-now\/","title":{"rendered":"Snakes and Ladders, or really just ladders for now"},"content":{"rendered":"<p>Spent some time working on ladders! They&#8217;re procedurally generated from a seed the same as the level is (and obviously need some tweaking). I&#8217;m still working on some of the physics of them. SpriteKit is really nice about setting the category, collision and contact bit masks (which call a delegate method), so it was easy to determine when a player was contacting a ladder.<\/p>\n<p><code>self.physicsBody.categoryBitMask = featuresCategory;<br \/>\nself.physicsBody.collisionBitMask = 0;<br \/>\nself.physicsBody.contactTestBitMask = playerCategory;<\/code><\/p>\n<p>I was hoping to simply set the player&#8217;s physics body&#8217;s <code>affectedByGravity<\/code> property to NO, but there&#8217;s some weirdness where it seems pre-existing velocity doesn&#8217;t go away (so the player will float up\/down when the user isn&#8217;t pressing any keys). I&#8217;ll work on that soon to sort it out, but it&#8217;s a bit more fun to explore the caves now! Video below:<\/p>\n<p><a href=\"http:\/\/www.evolpenguin.com\/GoldHunter\/Ladders.mov\">Ladders Video<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spent some time working on ladders! They&#8217;re procedurally generated from a seed the same as the level is (and obviously need some tweaking). I&#8217;m still working on some of the physics of them. SpriteKit is really nice about setting the category, collision and contact bit masks (which call a delegate method), so it was easy [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,24,13],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-code","category-game-development","category-project-update"],"_links":{"self":[{"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":0,"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alexsikora.com\/news\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}