{"id":1245,"date":"2025-05-09T21:09:37","date_gmt":"2025-05-09T21:09:37","guid":{"rendered":"https:\/\/sites.wsagames.com\/et4g23\/?p=1245"},"modified":"2025-05-10T18:47:28","modified_gmt":"2025-05-10T18:47:28","slug":"pitfalls","status":"publish","type":"post","link":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/","title":{"rendered":"Pitfalls"},"content":{"rendered":"\n<p class=\"has-text-align-center has-background\" style=\"background-color:#dfdfdf\">Another obstacle in the dungeons for the player to avoid, our idea is that they will deal a large amount of damage to the player if they were to fall into them, and then respawn the player in the room after they had fallen.<\/p>\n\n\n\n<p>The PitFall scripts starts with references to a <em><strong>Transform component <\/strong><\/em>called <em><strong>playerRespawn<\/strong><\/em>, which is where the player will respawn upon falling into the pitfall and a reference to an <em><strong>int damage = 2;<\/strong><\/em> , the amount of damage that will be dealt to the player if they fall into the pitfall.<\/p>\n\n\n\n<p>This Pitfall game object also has a BoxCollider2D component which is set to trigger. Which is used in the <em><strong>OnTriggerEnter2D() <\/strong><\/em>method to check if what has collided with the pitfall is the player. If it is the player, it will cause the player to take 2 HP of damage and prevent them from moving or attacking.<br>Then a <em><strong>Fall() <\/strong><\/em>coroutine is called which waits for 1 second (For a future fall animation to play), then takes the player to the playerRespawn transform and then re-allows the player to move and attack.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"598\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-1024x598.png\" alt=\"\" class=\"wp-image-1251\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-1024x598.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-300x175.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-768x449.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-850x497.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45.png 1275w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After implementing the Pitfall, we decided to allow thew player to dash over them, documented in this <a href=\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/player-pt-5\/\">Development Post<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Updating the Pitfall<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"891\" height=\"349\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-70.png\" alt=\"\" class=\"wp-image-1296\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-70.png 891w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-70-300x118.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-70-768x301.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-70-850x333.png 850w\" sizes=\"(max-width: 891px) 100vw, 891px\" \/><\/figure>\n\n\n\n<p>After the playtest, we had a lot of feedback concerning the pitfall. Players felt it was much too buggy to have the respawn point be a static point on in the room as opposed to it being that last area in the room the player stood on before falling into the pitfall. Furthermore, enemies were still active as the player went through the motions of falling into the pitfall and respawning &#8211; allowing them, on occasion, to deal damage to the player without the player being able to do anything.<\/p>\n\n\n\n<p>These were two large issues with the pitfall, however, instead of fixing the issues directly, we felt it was best to redesign the pitfall entirely. This was due to my lack of Unity and C# experience up to this point, despite being the group&#8217;s primary programmer and we felt this would save us a lot of time<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"619\" height=\"60\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-69.png\" alt=\"\" class=\"wp-image-1295\" style=\"width:840px;height:auto\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-69.png 619w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-69-300x29.png 300w\" sizes=\"(max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<p>Ultimately, we decided to change the pitfall into an obstacle that doesn&#8217;t do damage but merely as a &#8216;wall&#8217; type collider that the player can only move through by dashing. This would be a lot easier to implement and would work similarly to other existing 2D roguelike games (such as The Binding of Isaac).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"335\" src=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-71-1024x335.png\" alt=\"\" class=\"wp-image-1297\" srcset=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-71-1024x335.png 1024w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-71-300x98.png 300w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-71-768x251.png 768w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-71-850x278.png 850w, https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-71.png 1336w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To prevent the player from walking through Pitfalls, I gave them a BoxCollider2D component. However, the player would still need to be able to dash through them. In order to do this, I created a new <strong>Layer <\/strong>called <strong>&#8220;PlayerCanDashOver&#8221;<\/strong> and assigned it to the pitfall prefab. Then, in the <em><strong>Dash()<\/strong><\/em> method in the player&#8217;s <strong>PlayerControllerNew<\/strong> script, I used the <em><strong>Physics2D.IgnoreLayerCollision <\/strong><\/em>function and inputted the players&#8217; layer and the pitfall&#8217;s layer. This would prevent the player&#8217;s Collider component and the pitfall&#8217;s Collider component from colliding during the player&#8217;s dash.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another obstacle in the dungeons for the player to avoid, our idea is that they will deal a large amount of damage to the player if they were to fall into them, and then respawn the player in the room after they had fallen. The PitFall scripts starts with references to a Transform component called&#8230;<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1245","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Pitfalls - E-Jay Tripoli (Year 2 Archive)<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pitfalls - E-Jay Tripoli (Year 2 Archive)\" \/>\n<meta property=\"og:description\" content=\"Another obstacle in the dungeons for the player to avoid, our idea is that they will deal a large amount of damage to the player if they were to fall into them, and then respawn the player in the room after they had fallen. The PitFall scripts starts with references to a Transform component called...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/\" \/>\n<meta property=\"og:site_name\" content=\"E-Jay Tripoli (Year 2 Archive)\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-09T21:09:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-10T18:47:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-1024x598.png\" \/>\n<meta name=\"author\" content=\"et4g23\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"et4g23\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/\",\"name\":\"Pitfalls - E-Jay Tripoli (Year 2 Archive)\",\"isPartOf\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-1024x598.png\",\"datePublished\":\"2025-05-09T21:09:37+00:00\",\"dateModified\":\"2025-05-10T18:47:28+00:00\",\"author\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963\"},\"breadcrumb\":{\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#primaryimage\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45.png\",\"contentUrl\":\"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45.png\",\"width\":1275,\"height\":745},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sites.wsagames.com\/et4g23\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pitfalls\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#website\",\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/\",\"name\":\"E-Jay Tripoli (Year 2 Archive)\",\"description\":\"A documentation of my work for Year 2 - Studying Games Design and Art at the University of Southampton\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sites.wsagames.com\/et4g23\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963\",\"name\":\"et4g23\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g\",\"caption\":\"et4g23\"},\"url\":\"https:\/\/sites.wsagames.com\/et4g23\/author\/et4g23\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pitfalls - E-Jay Tripoli (Year 2 Archive)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/","og_locale":"en_US","og_type":"article","og_title":"Pitfalls - E-Jay Tripoli (Year 2 Archive)","og_description":"Another obstacle in the dungeons for the player to avoid, our idea is that they will deal a large amount of damage to the player if they were to fall into them, and then respawn the player in the room after they had fallen. The PitFall scripts starts with references to a Transform component called...","og_url":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/","og_site_name":"E-Jay Tripoli (Year 2 Archive)","article_published_time":"2025-05-09T21:09:37+00:00","article_modified_time":"2025-05-10T18:47:28+00:00","og_image":[{"url":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-1024x598.png","type":"","width":"","height":""}],"author":"et4g23","twitter_card":"summary_large_image","twitter_misc":{"Written by":"et4g23"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/","url":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/","name":"Pitfalls - E-Jay Tripoli (Year 2 Archive)","isPartOf":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#primaryimage"},"image":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#primaryimage"},"thumbnailUrl":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45-1024x598.png","datePublished":"2025-05-09T21:09:37+00:00","dateModified":"2025-05-10T18:47:28+00:00","author":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963"},"breadcrumb":{"@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#primaryimage","url":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45.png","contentUrl":"https:\/\/sites.wsagames.com\/et4g23\/wp-content\/uploads\/sites\/27\/2025\/05\/image-45.png","width":1275,"height":745},{"@type":"BreadcrumbList","@id":"https:\/\/sites.wsagames.com\/et4g23\/2025\/05\/09\/pitfalls\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sites.wsagames.com\/et4g23\/"},{"@type":"ListItem","position":2,"name":"Pitfalls"}]},{"@type":"WebSite","@id":"https:\/\/sites.wsagames.com\/et4g23\/#website","url":"https:\/\/sites.wsagames.com\/et4g23\/","name":"E-Jay Tripoli (Year 2 Archive)","description":"A documentation of my work for Year 2 - Studying Games Design and Art at the University of Southampton","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sites.wsagames.com\/et4g23\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/56387a1dc0de878bb33ce4c478f22963","name":"et4g23","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sites.wsagames.com\/et4g23\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/477d521b3b86e4ef27181bf784cd1a145a38c7d6a0154a478d3c858d26298bec?s=96&d=mm&r=g","caption":"et4g23"},"url":"https:\/\/sites.wsagames.com\/et4g23\/author\/et4g23\/"}]}},"_links":{"self":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/comments?post=1245"}],"version-history":[{"count":3,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1245\/revisions"}],"predecessor-version":[{"id":1298,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/posts\/1245\/revisions\/1298"}],"wp:attachment":[{"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/media?parent=1245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/categories?post=1245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wsagames.com\/et4g23\/wp-json\/wp\/v2\/tags?post=1245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}