{"id":562,"date":"2012-02-12T20:33:23","date_gmt":"2012-02-12T20:33:23","guid":{"rendered":"http:\/\/blogs.kent.ac.uk\/mik\/?p=562"},"modified":"2022-09-14T15:05:47","modified_gmt":"2022-09-14T15:05:47","slug":"joc-16","status":"publish","type":"post","link":"https:\/\/blogs.kcl.ac.uk\/proged\/2012\/02\/12\/joc-16\/","title":{"rendered":"JoC #16: Adding a score counter"},"content":{"rendered":"<p><em>\u00a0 \u00a0 \u00a0 Habe Mut, dich deines eigenen Verstandes zu bedienen.<\/em><br \/>\n<em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2014 Immanuel Kant<\/em><\/p>\n<p>Welcome back after a little break in putting out new episodes.<\/p>\n<p>I was at a conference for a week or so (Melbourne, other side of the world!), and then I had to get settled into my time zone again, but I&#8217;m back! I still feel a little jet-lagged, so if my voice sounds even more drab than usual in this episode \u2013 I blame the time zones.<\/p>\n<p>This episode deals with an incredibly important concept: object interaction. (It could actually also have been titled &#8220;Object interaction \u2013 a second look&#8221;.) We started to look at object interaction a little bit in Episode #15, and now we&#8217;re really getting stuck in. We&#8217;re throwing around terms like &#8220;object references&#8221; and &#8220;constructors&#8221;.<\/p>\n<p>Yes, we&#8217;re slowly cranking up to a more professional level here. So sit back, switch your brain on, and watch. And of course \u2014 as always \u2014 after watching: Fire up Greenfoot, and get coding yourself!<\/p>\n<p><iframe loading=\"lazy\" title=\"The Joy of Code #16: Adding a score counter\" width=\"584\" height=\"329\" src=\"https:\/\/www.youtube.com\/embed\/WIifij-961o?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p style=\"text-align: right\"><a href=\"http:\/\/www.greenfoot.org\/static\/joc\/mov\/JOC-16.mov\">Download video<\/a><\/p>\n<p>Oh, and one more thing: I am showing how to implement a score counter here, because several people have asked me how to do that. So if you have a question, or something you want explained: tell me in the comments, and I&#8217;ll try to fit it in in one of the future episodes.<\/p>\n<p><em>Update: This episode shows how to use a ready-made counter object. If you are interested in making such a counter yourself, you can now look at <a href=\"http:\/\/blogs.kent.ac.uk\/mik\/2012\/04\/joc-26\/\">Episode 26<\/a>.<\/em><\/p>\n<p><strong>Concepts discussed<\/strong>:\u00a0<em>object interaction, constructor<\/em><em>, field, local variable, assignment, external method call<\/em><\/p>\n<p>Downloads:\u00a0\u00a0<a href=\"http:\/\/www.greenfoot.org\/download\/files\/joc\/trick-the-turtle-v4.zip\">trick-the-turtle-v4.zip<\/a><\/p>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 \u00a0 Habe Mut, dich deines eigenen Verstandes zu bedienen. \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2014 Immanuel Kant Welcome back after a little break in putting out new episodes. I was at a conference for a week or &hellip; <a href=\"https:\/\/blogs.kcl.ac.uk\/proged\/2012\/02\/12\/joc-16\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":179,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,6],"tags":[38,49,68,71,78],"class_list":["post-562","post","type-post","status-publish","format-standard","hentry","category-greenfoot-software-tools","category-joy-of-code","tag-constructor","tag-field","tag-local-variable","tag-method-call","tag-object-interaction"],"_links":{"self":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/users\/179"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/comments?post=562"}],"version-history":[{"count":2,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/562\/revisions"}],"predecessor-version":[{"id":1116,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/562\/revisions\/1116"}],"wp:attachment":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/media?parent=562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/categories?post=562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/tags?post=562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}