{"author_link":"\/users\/daanvanyperen","author_name":"daanvanyperen","author_uid":"daanvanyperen","comments":[],"epoch":1494342953,"event":"LD38","format":"md","ldjam_node_id":30605,"likes":8,"metadata":{"p_key":"93103","p_author":"daanvanyperen","p_authorkey":"1006977","p_urlkey":"306021","p_title":"Little Fortune Planet Breakdown - Part 6: Finishing touches, deck of cards!","p_cat":"LDJam ","p_event":"LD38","p_time":"1494342953","p_likes":"8","p_comments":"0","p_status":"WAYBACK","us_key":"1006977","us_name":"daanvanyperen","us_username":"daanvanyperen","event_start":"1492732800","event_key":"69","event_name":"LD 38"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD38","removed_author":false},"_superparent":9405,"_trust":1,"author":6977,"body":"**Continued from [part 5](https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-planet-breakdown-part-5-performance-persmormanche).**\n\nWhile we coded the simulation **@Flaterectomy spent his time drawing loads of pretty cards**. We\u2019ll have to code mechanics so the user can pick a card, and have that card act upon the world.\n\n**To save some time for coding we\u2019ll want to enable @Flaterectomy to work on card metadata** by creating an external library of cards, a [CardSystem](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/blob\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/dilemma\/CardSystem.java) will be responsible for loading the metadata+scripts from a JSON file into our library.\n\n![image24.png](\/\/\/raw\/14b\/1\/z\/41fe.png)\n\nThe [CardSystem](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/blob\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/dilemma\/CardSystem.java) will also keep track of the cards in the player's hand, and spawning those cards as clickable entities in our ECS.\n\n![image21.gif](\/\/\/raw\/14b\/1\/z\/41ff.gif)\n\nA second system could **execute the scripts on each card ([CardSystem](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/blob\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/dilemma\/CardScriptSystem.java))** and **interact with other [systems](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/tree\/master\/core\/src\/net\/mostlyoriginal\/game\/system) to apply desired effects**.\n\n![image8.png](\/\/\/raw\/14b\/1\/z\/4200.png)\n\nThis is where **earlier choices start to pay off**. Our **toolkit of [components](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/tree\/master\/components\/src\/net\/mostlyoriginal\/game\/component) and [simulation systems](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/tree\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/planet\/cells) can be easily expanded** with scripted effects like **clouds, steam, evaporation, aliens that live inside a hollow earth and fall away from gravity, raining coffee shops, heat, etc**.\n\n![image11.gif](\/\/\/raw\/14b\/1\/z\/4201.gif)\n\nWe create **stencils of magma chutes, hollow earth**, that we can rotate and **apply onto the simulation** whenever certain cards are drawn **using the same logic we used to load the planet, just ignoring certain preexisting blocks**.\n\n![image2.png](\/\/\/raw\/14b\/1\/z\/4202.png) ![image9.png](\/\/\/raw\/14b\/1\/z\/4203.png)\n\n![image17.gif](\/\/\/raw\/14b\/1\/z\/4204.gif)\n\n**There we go!** Since the sandbox aspect is where we had the most fun, **we reward the player with achievements that can be used to edit the world directly**.\n\n![image3.gif](\/\/\/raw\/14b\/1\/z\/4205.gif)\n\n**That\u2019s it! Hope you enjoyed the series. You can play around with the [source](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet), [return to part 1 of this breakdown](https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-plane-breakdown-part-1-brainstorming), or [blow up your own planet](https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet)!**\n","comments":1,"comments-timestamp":"2017-05-13T20:16:11Z","created":"2017-05-09T14:54:02Z","files":[],"files-timestamp":0,"id":30605,"love":8,"love-timestamp":"2017-05-25T12:56:54Z","meta":[],"modified":"2017-05-25T12:56:54Z","name":"Little Fortune Planet Breakdown - Part 6: Finishing touches, deck of cards!","node-timestamp":"2017-05-09T15:15:53Z","parent":21490,"parents":[1,5,9,9405,21490],"path":"\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-planet-breakdown-part-6-finishing-touches-deck-of-cards","published":"2017-05-09T15:15:53Z","scope":"public","slug":"little-fortune-planet-breakdown-part-6-finishing-touches-deck-of-cards","subsubtype":"","subtype":"","type":"post","version":80814},"node_metadata":{"n_key":"30605","n_urlkey":"306021","n_parent":"21490","n_path":"\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-planet-breakdown-part-6-finishing-touches-deck-of-cards","n_slug":"little-fortune-planet-breakdown-","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"6977","n_created":"1494341642","n_modified":"1495717014","n_version":"80814","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-planet-breakdown-part-6-finishing-touches-deck-of-cards","text":"**Continued from [part 5](https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-planet-breakdown-part-5-performance-persmormanche).**\n\nWhile we coded the simulation **@Flaterectomy spent his time drawing loads of pretty cards**. We\u2019ll have to code mechanics so the user can pick a card, and have that card act upon the world.\n\n**To save some time for coding we\u2019ll want to enable @Flaterectomy to work on card metadata** by creating an external library of cards, a [CardSystem](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/blob\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/dilemma\/CardSystem.java) will be responsible for loading the metadata+scripts from a JSON file into our library.\n\n![image24.png](\/\/\/raw\/14b\/1\/z\/41fe.png)\n\nThe [CardSystem](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/blob\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/dilemma\/CardSystem.java) will also keep track of the cards in the player's hand, and spawning those cards as clickable entities in our ECS.\n\n![image21.gif](\/\/\/raw\/14b\/1\/z\/41ff.gif)\n\nA second system could **execute the scripts on each card ([CardSystem](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/blob\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/dilemma\/CardScriptSystem.java))** and **interact with other [systems](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/tree\/master\/core\/src\/net\/mostlyoriginal\/game\/system) to apply desired effects**.\n\n![image8.png](\/\/\/raw\/14b\/1\/z\/4200.png)\n\nThis is where **earlier choices start to pay off**. Our **toolkit of [components](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/tree\/master\/components\/src\/net\/mostlyoriginal\/game\/component) and [simulation systems](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet\/tree\/master\/core\/src\/net\/mostlyoriginal\/game\/system\/planet\/cells) can be easily expanded** with scripted effects like **clouds, steam, evaporation, aliens that live inside a hollow earth and fall away from gravity, raining coffee shops, heat, etc**.\n\n![image11.gif](\/\/\/raw\/14b\/1\/z\/4201.gif)\n\nWe create **stencils of magma chutes, hollow earth**, that we can rotate and **apply onto the simulation** whenever certain cards are drawn **using the same logic we used to load the planet, just ignoring certain preexisting blocks**.\n\n![image2.png](\/\/\/raw\/14b\/1\/z\/4202.png) ![image9.png](\/\/\/raw\/14b\/1\/z\/4203.png)\n\n![image17.gif](\/\/\/raw\/14b\/1\/z\/4204.gif)\n\n**There we go!** Since the sandbox aspect is where we had the most fun, **we reward the player with achievements that can be used to edit the world directly**.\n\n![image3.gif](\/\/\/raw\/14b\/1\/z\/4205.gif)\n\n**That\u2019s it! Hope you enjoyed the series. You can play around with the [source](https:\/\/github.com\/DaanVanYperen\/odb-little-fortune-planet), [return to part 1 of this breakdown](https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet\/little-fortune-plane-breakdown-part-1-brainstorming), or [blow up your own planet](https:\/\/ldjam.com\/events\/ludum-dare\/38\/little-fortune-planet)!**\n","title":"Little Fortune Planet Breakdown - Part 6: Finishing touches, deck of cards!","wayback_source":[]}