{"id":48,"date":"2018-05-19T19:14:28","date_gmt":"2018-05-19T19:14:28","guid":{"rendered":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/?p=48"},"modified":"2018-05-21T07:18:40","modified_gmt":"2018-05-21T07:18:40","slug":"problem-solved-on-chop-wood-with-object-literals","status":"publish","type":"post","link":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/problem-solved-on-chop-wood-with-object-literals\/","title":{"rendered":"Problem solved on chop wood with Object Literals"},"content":{"rendered":"<p><img loading=\"lazy\" src=\"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-content\/uploads\/2018\/05\/game-icons.png\" alt=\"Chop wood game icons\" width=\"940\" height=\"229\" class=\"alignnone size-full wp-image-50\" srcset=\"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-content\/uploads\/2018\/05\/game-icons.png 940w, https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-content\/uploads\/2018\/05\/game-icons-300x73.png 300w, https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-content\/uploads\/2018\/05\/game-icons-768x187.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/p>\n<p>My first ever attempt at creating my own app from scrap was <a href=\"https:\/\/www.lyndonantcliff.com\/forest-mood\/design-b.html\">Chop Wood<\/a>, which I can now call, <a href=\"https:\/\/www.lyndonantcliff.com\/forest-mood\/design.html\">Chop Wood, v.0.1<\/a><\/p>\n<p>It didn&#8217;t work, I couldn&#8217;t think how to create a variable which could be accessed by numerous functions whilst keep a true account of itself.<\/p>\n<p>The solution now seems so easy I am slightly embarrassed but still proud of my first creation.<\/p>\n<p>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.<\/p>\n<p>Progress with my learning has been made.<\/p>\n<p>I have realised it&#8217;s very hard, in the sense that when you try to understand something and can&#8217;t, it feels you can never understand the thing. But you have to keep moving forward and that is the hard bit, it&#8217;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.<\/p>\n<p>Which is weird, because normally if you try to go somewhere and don&#8217;t, you go another route.<\/p>\n<p>So now I can unveil <a href=\"https:\/\/www.lyndonantcliff.com\/forest-mood\/design-b.html\">Chop Wood v.02<\/a><\/p>\n<p>It now does everything I wanted it to.<br \/>\nNow I have to add more features and build out the mechanics.<br \/>\nMy 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.<\/p>\n<p>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.<\/p>\n<p>Go check out <a href=\"https:\/\/www.lyndonantcliff.com\/forest-mood\/design-b.html\">Chop Wood v0.2<\/a> and share thoughts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My first ever attempt at creating my own app from scrap was Chop Wood, which I can now call, Chop Wood, v.0.1 It didn&#8217;t work, I couldn&#8217;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 &hellip; <a href=\"https:\/\/www.lyndonantcliff.com\/learning-to-code\/problem-solved-on-chop-wood-with-object-literals\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Problem solved on chop wood with Object Literals<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":50,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/posts\/48"}],"collection":[{"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":3,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":53,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/posts\/48\/revisions\/53"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/media\/50"}],"wp:attachment":[{"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lyndonantcliff.com\/learning-to-code\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}