It didn’t work, I couldn’t think how to create a variable which could be accessed by numerous functions whilst keep a true account of itself.
The solution now seems so easy I am slightly embarrassed but still proud of my first creation.
Using object literals I have solved the issue with scope and keeping proper track of the values of the variables. Although I am still not clear about values and references of variables. Let and const are one ways this is defined, I have read a number of articles on the subject but the concepts have not yet clicked.
Progress with my learning has been made.
I have realised it’s very hard, in the sense that when you try to understand something and can’t, it feels you can never understand the thing. But you have to keep moving forward and that is the hard bit, it’s the recognition that despair and running to stand still are perfectly normal feelings to have and do not mean you are not getting anywhere.
Which is weird, because normally if you try to go somewhere and don’t, you go another route.
So now I can unveil Chop Wood v.02
It now does everything I wanted it to.
Now I have to add more features and build out the mechanics.
My inspirations is obviously all those crafting games which are played, I find the gathering, crafting, building mechanics very interesting. As well as an in-game economy.
Long way to go yet, my time line is I would have something to put on the app store in three months. In the meantime I will have learn a lot.
Go check out Chop Wood v0.2 and share thoughts.