{"id":26042,"date":"2024-03-15T10:33:42","date_gmt":"2024-03-15T02:33:42","guid":{"rendered":"http:\/\/hazlina-backup-26042"},"modified":"2024-03-15T10:33:42","modified_gmt":"2024-03-15T02:33:42","slug":"bte-1522-innovation-python-act-1-2-3","status":"publish","type":"post","link":"\/hazlina-blog\/2024\/03\/15\/bte-1522-innovation-python-act-1-2-3\/","title":{"rendered":"BTE1522 \u2013 Innovation (Python) \u2013 Act 1 2 3"},"content":{"rendered":"<p>Hi BTE 3232 Innovators,<\/p>\n<p>In today&#8217;s class, we&#8217;ve ventured into a simple game development, utilizing the powerful Pygame library to bring our ideas to life.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26049\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/a1-2-1024x576.png\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/a1-2-1024x576.png 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/a1-2-300x169.png 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/a1-2-768x432.png 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/a1-2-1200x674.png 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/a1-2.png 1918w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26044\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1.jpeg 1156w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26045\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-2-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-2-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-2-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-2-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-2.jpeg 1156w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26046\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-3-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-3-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-3-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-3-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-3.jpeg 1156w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26047\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/WhatsApp-Image-2024-03-15-at-11.11.08.jpeg 1156w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>Let&#8217;s recap the key pseudo codes we&#8217;ve explored, simplifying them for better understanding.<\/p>\n<ul>\n<li><strong>Step 1 \u2013 Setting Up the Game Window<\/strong><br \/>\nThe first step in any game development endeavor is setting up the game window. In our case, we defined the dimensions of our game window using the Pygame library, specifying its width and height. This step is crucial as it establishes the canvas on which our game will unfold. Understanding the pixel system in Python is vital here, as it allows us to position game elements accurately within the window.<\/li>\n<\/ul>\n<p><iframe loading=\"lazy\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/D6RsKh-JC4w?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen title=\"3 -  Coordinate Systems\"><\/iframe><\/p>\n<p>We defined the dimensions of our game window using the Pygame library, specifying its width and height in pixels. This step is crucial as it establishes the canvas on which our game will unfold, ensuring that every pixel is utilized effectively. Understanding the pixel system in Python is vital here, as it allows us to position game elements accurately within the window.<\/p>\n<p><iframe loading=\"lazy\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/TV-LNTVK7Nc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen title=\"2 -  colour systems\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Step 2 \u2013 Defining the Player<\/strong><br \/>\nWith the game window in place, we turned our attention to defining the player character. Using variables to represent properties such as color, width, height, and starting position, we laid the foundation for our protagonist. This step is essential as it breathes life into our game, providing us with a central element around which the gameplay will revolve. Understanding how to manipulate these variables using Python operators and expressions allows us to customize our player character to suit our game&#8217;s requirements.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Step 3 \u2013 Implementing Player Movements<\/strong><\/li>\n<\/ul>\n<p>With the player character defined, the next logical step was to implement player movements. Through keyboard interaction, we enabled our players to control the protagonist&#8217;s movements within the game window. By listening for keyboard events and responding accordingly, we ensured smooth and intuitive gameplay. This step highlights the importance of control statements, particularly conditional statements like if, elif, and else, which allow us to handle various user inputs and dictate the character&#8217;s behavior in different scenarios.<\/p>\n<p>Next class will be:-<br \/>\nAs we continue our journey in BTE 3232 Innovation, we&#8217;ve laid a solid foundation for our game development endeavors. Understanding the basics of setting up the game window, defining player characters, and implementing player movements is crucial as we dive deeper into more complex game mechanics and features. With each step forward, we inch closer to realizing our vision for our very own slider game.<\/p>\n<p>Stay tuned for more exciting adventures as we explore advanced concepts and unleash our creativity in Python game development!<\/p>\n<p><iframe loading=\"lazy\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/epMtTpQuQrE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen title=\"Python Programming Activities\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi BTE 3232 Innovators, In today&#8217;s class, we&#8217;ve ventured into a simple game development, utilizing the powerful Pygame library to bring our ideas to life. Let&#8217;s recap the key pseudo codes we&#8217;ve explored, simplifying them for better understanding. Step 1 \u2013 Setting Up the Game Window The first step in any game development endeavor is &hellip; <a href=\"\/hazlina\/2024\/03\/15\/bte-1522-innovation-python-act-1-2-3\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;BTE1522 \u2013 Innovation (Python) \u2013 Act 1 2 3&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[13],"class_list":["post-26042","post","type-post","status-publish","format-standard","hentry","category-information","tag-academia-python-prog"],"_links":{"self":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/26042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/comments?post=26042"}],"version-history":[{"count":0,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/26042\/revisions"}],"wp:attachment":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/media?parent=26042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/categories?post=26042"},{"taxonomy":"post_tag","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/tags?post=26042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}