How I fit my game inside a table
(Talking about https://ldjam.com/events/ludum-dare/40/too-much-money-earning-simulator )
This jam I didn’t have much time, so I had to make something really easy and fast to programm. Here are some “tricks” I used:
Trick #1: One variable
Game is tile based and each tile has only one variable: Money.

Trick #2: One State
Each tile has one state: "Which building is it"
Trick #3: Two Events
Each tile has two evens:
1. Passive: happens every second.
2. Overflow: happens: when tile has too much money. (special action)
- Few money – no chance of overflow;
- Lots of money – 10% chance to overflow;
- Way too much money – Will definetly overflow;

Trick #4: One interaction
The only way to interact with the game is to click on a tile. Each tile type has it’s unique action

To Recap, here is a sample info dialog

This 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.
So what now? Well, I can define each tile using a table (Spoilers):

- name: just a name and unique identifier
- sprite: a sprite name x.png in my resource folder
- ofMin: when tile reaches this amount of money, it might overflow
- ofMax: when tile reaches this amount of money, it will overflow
- onClick: What happens when you click the tile
- onPasive: What happens every second with the tile
- onOF: What happens when tile overflows
- toolTip: text that is shown when we hover over the tile.