{"author_link":"\/users\/fancyreckless","author_name":"FancyReckless","author_uid":"fancyreckless","comments":[],"epoch":1513276012,"event":"LD40","format":"md","ldjam_node_id":71063,"likes":7,"metadata":{"p_key":"107328","p_author":"FancyReckless","p_authorkey":"1056263","p_urlkey":"323138","p_title":"How I fit my game inside a table","p_cat":"LDJam ","p_event":"LD40","p_time":"1513276012","p_likes":"7","p_comments":"0","p_status":"WAYBACK","us_key":"1056263","us_name":"FancyReckless","us_username":"fancyreckless","event_start":"1512086400","event_key":"70","event_name":"LD 40"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD40","removed_author":false},"_superparent":49883,"_trust":5,"author":56263,"body":"(Talking about https:\/\/ldjam.com\/events\/ludum-dare\/40\/too-much-money-earning-simulator )\n\nThis jam I didn\u2019t have much time, so I had to make something really easy and fast to programm. Here are some \u201ctricks\u201d I used:\n\n## Trick #1: One variable\n\nGame is tile based and each tile has only one variable: **Money**.\n\n![OneVariable.png](\/\/\/raw\/7cb\/d\/z\/e955.png)\n\n## Trick #2: One State\n\nEach tile has one state: \"Which building is it\"\n\n## Trick #3: Two Events\n\nEach tile has two evens: \n1. **Passive**: happens every second.\n2. **Overflow**: happens: when tile has too much money. (special action)  \n    - Few money \u2013 no chance of overflow;\n    - Lots of money \u2013 10% chance to overflow;\n    - Way too much money \u2013 Will definetly overflow;\n\n![Overflow.png](\/\/\/raw\/7cb\/d\/z\/e956.png)\n\n\n## Trick #4: One interaction\nThe only way to interact with the game is to **click on a tile**. Each tile type has it\u2019s unique action\n\n![OnHover.png](\/\/\/raw\/7cb\/d\/z\/e957.png)\n\nTo Recap, here is a sample info dialog\n\n![Info.png](\/\/\/raw\/7cb\/d\/z\/e958.png)\n\nThis means that Mill1 tile will passively cut forest tiles and when it has too much money, it will upgrade to better mill. (Which is worse for you). Hovewer you can prevent it by clicking on it, which will decrease the money of this tile, but give you more money.\n\n\n\n### So what now? Well, I can define each tile using a table (Spoilers):\n\n![Table.png](\/\/\/raw\/7cb\/d\/z\/e95b.png)\n\n\n- **name**: just a name and unique identifier  \n- **sprite**: a sprite name x.png in my resource folder  \n- **ofMin**: when tile reaches this amount of money, it might overflow  \n- **ofMax**: when tile reaches this amount of money, it will overflow  \n- **onClick**: What happens when you click the tile  \n- **onPasive**: What happens every second with the tile  \n- **onOF**: What happens when tile overflows  \n- **toolTip**: text that is shown when we hover over the tile.  \n\n#### And in this way all I have to do to create new tile, is just add a row in a table. ","comments":0,"created":"2017-12-14T16:26:37Z","files":[],"files-timestamp":0,"id":71063,"love":7,"love-timestamp":"2017-12-15T00:06:52Z","meta":[],"modified":"2017-12-15T00:06:52Z","name":"How I fit my game inside a table","node-timestamp":"2017-12-14T18:26:52Z","parent":63807,"parents":[1,5,9,49883,63807],"path":"\/events\/ludum-dare\/40\/too-much-money-earning-simulator\/how-i-fit-my-game-inside-a-table","published":"2017-12-14T18:26:52Z","scope":"public","slug":"how-i-fit-my-game-inside-a-table","subsubtype":"","subtype":"","type":"post","version":208807},"node_metadata":{"n_key":"71063","n_urlkey":"323138","n_parent":"63807","n_path":"\/events\/ludum-dare\/40\/too-much-money-earning-simulator\/how-i-fit-my-game-inside-a-table","n_slug":"how-i-fit-my-game-inside-a-table","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"56263","n_created":"1513268797","n_modified":"1513296412","n_version":"208807","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/40\/too-much-money-earning-simulator\/how-i-fit-my-game-inside-a-table","text":"(Talking about https:\/\/ldjam.com\/events\/ludum-dare\/40\/too-much-money-earning-simulator )\n\nThis jam I didn\u2019t have much time, so I had to make something really easy and fast to programm. Here are some \u201ctricks\u201d I used:\n\n## Trick #1: One variable\n\nGame is tile based and each tile has only one variable: **Money**.\n\n![OneVariable.png](\/\/\/raw\/7cb\/d\/z\/e955.png)\n\n## Trick #2: One State\n\nEach tile has one state: \"Which building is it\"\n\n## Trick #3: Two Events\n\nEach tile has two evens: \n1. **Passive**: happens every second.\n2. **Overflow**: happens: when tile has too much money. (special action)  \n    - Few money \u2013 no chance of overflow;\n    - Lots of money \u2013 10% chance to overflow;\n    - Way too much money \u2013 Will definetly overflow;\n\n![Overflow.png](\/\/\/raw\/7cb\/d\/z\/e956.png)\n\n\n## Trick #4: One interaction\nThe only way to interact with the game is to **click on a tile**. Each tile type has it\u2019s unique action\n\n![OnHover.png](\/\/\/raw\/7cb\/d\/z\/e957.png)\n\nTo Recap, here is a sample info dialog\n\n![Info.png](\/\/\/raw\/7cb\/d\/z\/e958.png)\n\nThis means that Mill1 tile will passively cut forest tiles and when it has too much money, it will upgrade to better mill. (Which is worse for you). Hovewer you can prevent it by clicking on it, which will decrease the money of this tile, but give you more money.\n\n\n\n### So what now? Well, I can define each tile using a table (Spoilers):\n\n![Table.png](\/\/\/raw\/7cb\/d\/z\/e95b.png)\n\n\n- **name**: just a name and unique identifier  \n- **sprite**: a sprite name x.png in my resource folder  \n- **ofMin**: when tile reaches this amount of money, it might overflow  \n- **ofMax**: when tile reaches this amount of money, it will overflow  \n- **onClick**: What happens when you click the tile  \n- **onPasive**: What happens every second with the tile  \n- **onOF**: What happens when tile overflows  \n- **toolTip**: text that is shown when we hover over the tile.  \n\n#### And in this way all I have to do to create new tile, is just add a row in a table. ","title":"How I fit my game inside a table","wayback_source":[]}