{"author_link":"\/users\/liquidfunk","author_name":"LiquidFunk","author_uid":"liquidfunk","comments":[],"epoch":1650057683,"event":"LD50","format":"md","ldjam_node_id":292793,"likes":9,"metadata":{"p_key":"166107","p_author":"LiquidFunk","p_authorkey":"1187994","p_urlkey":"391835","p_title":"Godot & Walkable Areas","p_cat":"LDJam ","p_event":"LD50","p_time":"1650057683","p_likes":"9","p_comments":"0","p_status":"WAYBACK","us_key":"1187994","us_name":"LiquidFunk","us_username":"liquidfunk","event_start":"1648857600","event_key":"110","event_name":"Ludum Dare 50"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD50","removed_author":false},"_superparent":276397,"_trust":3,"author":187994,"body":"The great thing about Godot is that it helps you do complicated things in an extremely simple way. For example, in our game called [Fronk Frizby - Qoffee Cuest](https:\/\/ldjam.com\/events\/ludum-dare\/50\/fronk-frizby-qoffee-cuest) we utilize tile sets and their built in collision functionality to produce unwalkable tiles:\n\n![Screenshot 2022-04-15 231432.png](\/\/\/raw\/a5e\/d2\/z\/4e0d2.png)\n\nWhat's so great about this? Well, since the player object is a KinematicBody2D with a child node of type CollisionShape2D, the player will automatically be unable to walk into any tile's collision shape. Great stuff!\n\nAfter setting up the tile set we could easily place trees all over the game and the player could not walk through them. All without a single line of code.\n\nFor those of you who have played the game, towards the end we have a more interesting scene with unwalkable areas not created from a tileset. How did we solve this? Simple! By manually drawing a CollisionPolygon2D (belonging to a StaticBody2D object) on top of the background. Here's a peek at what that looks like (the background itself is not visible due to spoilers :wink:):\n\n![Screenshot 2022-04-15 231954.png](\/\/\/raw\/a5e\/d2\/z\/4e0d3.png)\n\nAs you can see, the polygon covers most of the screen and the areas that it does cover are not walkable.\n\nI hope you found this post enjoyable, feel free to play our game and let us know what you thought of it! :video_game: ","comments":2,"comments-timestamp":"2022-04-15T22:46:34Z","created":"2022-04-15T21:11:50Z","files":[],"files-timestamp":0,"id":292793,"love":9,"love-timestamp":"2022-04-16T13:43:36Z","meta":[],"modified":"2022-04-16T13:43:36Z","name":"Godot & Walkable Areas","node-timestamp":"2022-04-15T21:22:20Z","parent":277655,"parents":[1,5,9,276397,277655],"path":"\/events\/ludum-dare\/50\/fronk-frizby-qoffee-cuest\/godot-walkable-areas","published":"2022-04-15T21:21:23Z","scope":"public","slug":"godot-walkable-areas","subsubtype":"","subtype":"","type":"post","version":909513},"node_metadata":{"n_key":"292793","n_urlkey":"391835","n_parent":"277655","n_path":"\/events\/ludum-dare\/50\/fronk-frizby-qoffee-cuest\/godot-walkable-areas","n_slug":"godot-walkable-areas","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"187994","n_created":"1650057110","n_modified":"1650116616","n_version":"909513","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/50\/fronk-frizby-qoffee-cuest\/godot-walkable-areas","text":"The great thing about Godot is that it helps you do complicated things in an extremely simple way. For example, in our game called [Fronk Frizby - Qoffee Cuest](https:\/\/ldjam.com\/events\/ludum-dare\/50\/fronk-frizby-qoffee-cuest) we utilize tile sets and their built in collision functionality to produce unwalkable tiles:\n\n![Screenshot 2022-04-15 231432.png](\/\/\/raw\/a5e\/d2\/z\/4e0d2.png)\n\nWhat's so great about this? Well, since the player object is a KinematicBody2D with a child node of type CollisionShape2D, the player will automatically be unable to walk into any tile's collision shape. Great stuff!\n\nAfter setting up the tile set we could easily place trees all over the game and the player could not walk through them. All without a single line of code.\n\nFor those of you who have played the game, towards the end we have a more interesting scene with unwalkable areas not created from a tileset. How did we solve this? Simple! By manually drawing a CollisionPolygon2D (belonging to a StaticBody2D object) on top of the background. Here's a peek at what that looks like (the background itself is not visible due to spoilers :wink:):\n\n![Screenshot 2022-04-15 231954.png](\/\/\/raw\/a5e\/d2\/z\/4e0d3.png)\n\nAs you can see, the polygon covers most of the screen and the areas that it does cover are not walkable.\n\nI hope you found this post enjoyable, feel free to play our game and let us know what you thought of it! :video_game: ","title":"Godot & Walkable Areas","wayback_source":[]}