{"author_name":"joecarrot","cat":"LD #29","comments":[{"author_name":"CaveDweller","time":"April 26, 2014 12:00 pm","epoch":1398531600,"text":"I would personally set it up such that there are regular map tiles and interactive tiles, which each hold their own sort of &#8220;status effect&#8221; or some similar system. Maybe something as simple as handling input differently- in this case, that would switch over whatever you&#8217;re normally using to &#8220;ladder mode&#8221; where, for example, W increases the player&#8217;s Y and S decreases it.","spam":"N"}],"epoch":1398530520,"likes":3,"metadata":{"p_key":"31743","p_author":"joecarrot","p_authorkey":"18779","p_urlkey":"67238","p_title":"How a ladder could work.","p_cat":"LD #29","p_event":"LD29","p_time":"1398530520","p_likes":"3","p_comments":"1","p_status":"UPD5","us_key":"18779","us_name":"joecarrot","us_username":"joecarrot","event_start":"1398384000","event_key":"22","event_name":"LD29"},"text":"<p>Okay, writing this here to get down some thoughts for later (after a shower), and also in case it might help someone else down the line.<\/p>\n <p>A ladder is a bit more complex a scenario than I originally anticipated. It&#8217;s not enough to just say so and so object is &#8216;nearLadder&#8217; and allow them to float around on the Y axis. There are a few different scenarios that happen when a player gets near a ladder, which all need their own behaviors.<\/p>\n <h2>1: Player walks next to bottom of ladder<\/h2>\n <p><img class=\"alignnone size-full wp-image-346540\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/04\/ladder_walk_over.gif\" alt=\"ladder_walk_over\" width=\"320\" height=\"151\" \/><\/p>\n <p>In this most basic scenario, the player could have some kind of variable set that it is over a ladder and can climb. Being able to climb should allow the player to modify their Y location via input. The basic climbing stuff.<\/p>\n <h2>2. Player\u00a0climbs ladder<\/h2>\n <p><img class=\"alignnone size-full wp-image-346563\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/04\/player_climb_ladder.gif\" alt=\"player_climb_ladder\" width=\"320\" height=\"194\" \/><\/p>\n <p>For this scenario, some basic climbing animation could play. In my case, I am setting the gravity scale for the player to 0, but that has it&#8217;s own issues.<\/p>\n <h2>3. Player\u00a0walks next to top of ladder<\/h2>\n <p><img class=\"alignnone size-full wp-image-346589\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/04\/player_top_ladder_float.gif\" alt=\"player_top_ladder_float\" width=\"320\" height=\"201\" \/><\/p>\n <p>And here is the issue. If you set the gravity scale to 0 when near a ladder, coming from the top makes the character float! Instead, I think a variable isClimbing could get set if the player presses up or down while over a ladder, otherwise, the player falls as normal.<\/p>\n <h2>4. Player\u00a0climbs partially up ladder then jumps<\/h2>\n <p>This should set isClimbing to false, and since I&#8217;m using grounded checks to allow climbing, ladders should ground the player the whole way.<\/p>\n <p>&nbsp;<\/p>\n <p>So a state machine would be something like:<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/04\/Screen-Shot-2014-04-26-at-1.41.22-PM.png\"><img class=\"alignnone size-full wp-image-346719\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/04\/Screen-Shot-2014-04-26-at-1.41.22-PM.png\" alt=\"Screen Shot 2014-04-26 at 1.41.22 PM\" width=\"540\" height=\"563\" \/><\/a><\/p>\n <p>&nbsp;<\/p>\n <p>Well that&#8217;s a start anyway.<\/p>\n <p>&nbsp;<\/p>\n <p>&nbsp;<\/p>","time":"April 26th, 2014 11:42 am","title":"How a ladder could work."}