{"id":1807,"date":"2019-04-15T13:13:31","date_gmt":"2019-04-15T11:13:31","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=1807"},"modified":"2019-04-25T18:04:45","modified_gmt":"2019-04-25T16:04:45","slug":"fullgameipad","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/fullgameipad\/","title":{"rendered":"Create a game with an Ipad and Python (Full \/ wip)"},"content":{"rendered":"<h1>Welcome to Pythonista<\/h1>\n<p>&nbsp;<\/p>\n<p>In the following videos I will start explaining how to maka a videogame with the Ipad and Python, through the app Pythonista. This app is not free, but it&#8217;s the coolest app to code on the Ipad, in my opinion. You can easily create a videogame. This post is a work on progress: you will find new videos every two &#8211; three days. Stay tuned.<\/p>\n<h2>History of post updates:<\/h2>\n<ul>\n<li>(new) 19\/04\/2019: new video with player sprite added to the ground<\/li>\n<li>before 19\/04\/2019: two videos with background and sprite for the &#8216;ground&#8217;<\/li>\n<\/ul>\n<h1>The game: step by step<\/h1>\n<h1>The sky is blue! Aka Let&#8217;s show the background<\/h1>\n<p>This code is based on the module scene for the animation in 2d on the ipad through Python. Here is the documentation: <a href=\"http:\/\/omz-software.com\/pythonista\/docs\/ios\/scene.html#introduction\">link to the documentation of scene module<\/a>.<\/p>\n<p>The first thing that we are going to do is to color the background. Nothing fancy, just a nice blue color. And it is very easy to do it, we just add an attribute to our object that is, by the way, called background.<\/p>\n<p><iframe loading=\"lazy\" title=\"Pythonista game on Ipad - part 1: the background\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/x3mRmpVZ-7U?feature=oembed&amp;enablejsapi=1\" 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<h2>Let&#8217;s put our feet on the earth: aka let&#8217;s draw some land<\/h2>\n<p>Now let&#8217;s draw the ground where our character will put his feet on, because we will have gravity&#8230; and we will use the &#8216;gravity&#8217; to move our sprite in the next videos.<\/p>\n<p><iframe loading=\"lazy\" title=\"Pythonistas game on Ipad - part 2: the ground\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/deyrZK2tzSE?feature=oembed&amp;enablejsapi=1\" 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<h2>Here come the player, with feet on the ground<\/h2>\n<p>Now it&#8217;s time for the actor of our game. What actor will we choose? An alien, of course, why not. It&#8217;s a cute alien, do not worry and it comes with the free stuffs included in Pythonista.<\/p>\n<p><iframe loading=\"lazy\" title=\"Pythonista game on Ipad - part 3: the player\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/nspi26FmyYs?feature=oembed&amp;enablejsapi=1\" 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<h2>Move, move&#8230; move!<\/h2>\n<p>Now it&#8217;s time for our Alien sprite to move around this little planet and try to survive. Let&#8217;s command him moving the ipad&#8230; cool, isn&#8217;t it?<\/p>\n<p><iframe loading=\"lazy\" title=\"Pythonista Game on Ipad - part. 4: player moves\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/Y5ziNl-A6Gs?feature=oembed&amp;enablejsapi=1\" 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<h2>Avoid going outside the screen<\/h2>\n<p>Let&#8217;s change a line of our code to avoid our Alien Sprite from going outside the screen. You can find many examples about the documentation of pythonista here: <a href=\"http:\/\/omz-software.com\/pythonista\/docs\/ios\/scene.html#introduction\">click here for the doc<\/a><\/p>\n<p><iframe loading=\"lazy\" title=\"Pyhtonista Game on Ipad - part 5: screen size limit movement\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/7vLu49xgrAk?feature=oembed&amp;enablejsapi=1\" 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<h2>The playlist with all the videos of the tutorial serie<\/h2>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=x3mRmpVZ-7U&amp;list=PL_38rYkBIiiXPxs5FbuGo4zZh-WHlnmZg&amp;index=1\">Watch the playlist<\/a><\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/videoseries?list=PL_38rYkBIiiXPxs5FbuGo4zZh-WHlnmZg\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\t<script>\r\n\t\tvar title = \"Game on Ipad with Pythonista\";\r\n\t\tvar links = [\r\n\t\t\t\/\/ ['final part of the address'],['title']\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/ipad-and-python-make-a-game\/\",\"The background of the scene\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/ipad-and-pythonista-make-a-game-2\",\"Draw the sprites\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/create-a-game-with-an-ipad-and-python-video-1-and-2\/\",\"Pythonista game p-1\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/pythonista-game-on-ipad-part-2\/\",\"Pythonista game p.2\"],\r\n\t\t\t]\r\n\t\t];\r\n<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\r\n\r\n\t<h3>External links<\/h3>\r\n\t<a href=\"https:\/\/youtu.be\/kBnt7kiZf1o\">Video about pythonista in classroom<\/a>\r\n\r\n\n","protected":false},"excerpt":{"rendered":"Create a game with Pythonista on the Ipad: a work in progress that will take you in a journey through a practical example of making a game with the Ipad.\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/fullgameipad\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,154,266,50],"tags":[137,225,4,226],"class_list":["post-1807","post","type-post","status-publish","format-standard","hentry","category-examples","category-games","category-tutorial","category-video","tag-game","tag-ipad","tag-python","tag-pythonista"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=1807"}],"version-history":[{"count":11,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1807\/revisions"}],"predecessor-version":[{"id":1877,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1807\/revisions\/1877"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=1807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=1807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=1807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}