{"id":7932,"date":"2014-06-05T05:02:34","date_gmt":"2014-06-04T19:02:34","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7932"},"modified":"2014-06-05T05:02:34","modified_gmt":"2014-06-04T19:02:34","slug":"objective-c-player-and-game-oop-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/objective-c-player-and-game-oop-primer-tutorial\/","title":{"rendered":"Objective-C Player and Game OOP Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/C\/Objective-C\/PlayerAndGame\/\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Objective-C Player and Game OOP Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/C\/Objective-C\/PlayerAndGame\/PlayerAndGame_Objective_C_Primer-30of.jpg\" title=\"Objective-C Player and Game OOP Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Objective-C Player and Game OOP Primer Tutorial<\/p><\/div>\n<p>There is change in the <a target=_blank href='http:\/\/taocurrents.files.wordpress.com\/2011\/12\/mp13a.jpg?w=529&#038;h=576' title='Thanks for this.'>wind<\/a>.  And they call the wind <a target=_blank href='http:\/\/www.youtube.com\/watch?v=3DrOqRQQ9mg' title='They call the wind Mariah'>Mariah<\/a>.  Do you see how those butterflies in Brazil have been flapping faster?<\/p>\n<p>Let me explain.  With Apple iOS 8 there could be big changes to programming arrangements, and it could be that you need to study Swift (is a <a target=_blank href='https:\/\/www.google.com.au\/?gfe_rd=ctrl&#038;ei=3s4rU6TsBsHC8gfOtYHAAw&#038;gws_rd=cr#q=%22Swift%22+%22iOS%22' title='Thanks'>Google search<\/a> in order?).  But we are still in the here and now, and today&#8217;s tutorial is about Objective C, the current iOS language of choice.<\/p>\n<p>Today we just do some simpler OOP work and create two pared down classes called Player and Game.   In the main function of our Xcode Objective-C OS-X Foundation project&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/C\/Objective-C\/PlayerAndGame\/main.m_GETME\" title='main.m'>main.m<\/a> source code, we create two Player objects (an object is the instantiation of a class), and this has to be done, for our arrangements, if you expect to be able to play a Game &#8230; though some people say &#8220;Solitaire&#8217;s the only game in town &#8230;&#8221; the more verbose (amongst us)  go &#8230;<\/p>\n<p><font size=\"1\"><\/p>\n<p>There was a man<br \/>\nA lonely man<br \/>\nWho lost his love<br \/>\nThrough his indifference<\/p>\n<p>A heart that cared<br \/>\nThat went unshared<br \/>\nUntil it died<br \/>\nWithin his silence<\/p>\n<p>And solitaire&#8217;s the only game in town<br \/>\nAnd every road that takes him, takes him down<br \/>\nAnd by himself it&#8217;s easy to pretend<br \/>\nHe&#8217;ll never love again<\/p>\n<p>And keeping to himself he plays the game<br \/>\nWithout her love it always ends the same<br \/>\nWhile life goes on around him everywhere<br \/>\nHe&#8217;s playing solitaire<\/p>\n<p>A little hope<br \/>\nGoes up in smoke<br \/>\nJust how it kills<br \/>\nGoes without saying<\/p>\n<p>There was a man<br \/>\nA lonely man<br \/>\nWho would command<br \/>\nThe hand he&#8217;s playing<\/p>\n<p>And solitaire&#8217;s the only game in town<br \/>\nAnd every road that takes him, takes him down<br \/>\nAnd by himself it&#8217;s easy to pretend<br \/>\nHe&#8217;ll never love again<\/p>\n<p>And keeping to himself he plays the game<br \/>\nWithout her love it always ends the same<br \/>\nWhile life goes on around him everywhere<br \/>\nHe&#8217;s playing solitaire<\/p>\n<p>And solitaire&#8217;s the only game in town<br \/>\nAnd every road that takes him, takes him down<br \/>\nWhile life goes on around him everywhere<br \/>\nHe&#8217;s playing solitaire<\/p>\n<p><\/font><a target=_blank title='Solitaire lyrics' href='http:\/\/www.metrolyrics.com\/solitaire-lyrics-the-carpenters.html'>Thanks a lot.<\/a><\/p>\n<p>As you can see no matter what the future brings mobile iOS wise, desktop applications in Objective-C can be used to perform that software functionality you need &#8230; how ARE you going with that unobtrusive percolator as you swing out of bed &#8220;timed to perfection&#8221; idea you started 7 years ago?<\/p>\n<p>Hope you get something out of today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/C\/Objective-C\/PlayerAndGame\/\" title='Click picture.'>tutorial<\/a>.   We give thanks to <i>Objective-C<\/i> by Steven Holzner for the gist of the coding ideas presented today.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#7932' onclick='var dv=document.getElementById(\"d7932\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=Objective-C\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7932' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>There is change in the wind. And they call the wind Mariah. Do you see how those butterflies in Brazil have been flapping faster? Let me explain. With Apple iOS 8 there could be big changes to programming arrangements, and &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/objective-c-player-and-game-oop-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15,28,37,40],"tags":[91,319,477,626,725,852,875,997,1319,1473],"class_list":["post-7932","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-oop","category-tutorials","category-xcode","tag-apple","tag-desktop","tag-games-2","tag-ios","tag-mac-os-x","tag-objective-c","tag-oop","tag-programming","tag-tutorial","tag-xcode"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/7932"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=7932"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/7932\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=7932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=7932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=7932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}