{"id":26153,"date":"2024-03-22T16:56:46","date_gmt":"2024-03-22T08:56:46","guid":{"rendered":"http:\/\/hazlina-backup-26153"},"modified":"2024-03-22T16:56:46","modified_gmt":"2024-03-22T08:56:46","slug":"bte1522-innovation-python-act-4-5","status":"publish","type":"post","link":"\/hazlina-blog\/2024\/03\/22\/bte1522-innovation-python-act-4-5\/","title":{"rendered":"BTE1522 \u2013 Innovation (Python) \u2013 Week 3 \u2013 Act 4 5"},"content":{"rendered":"<figure><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26159\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/Slide11-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/Slide11-1024x576.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide11-300x169.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide11-768x432.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide11-1200x675.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide11.jpg 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<p>Hi BTE1522 Innovators,<\/p>\n<p>As we progress further into our journey of Python game development, let&#8217;s recap on the activities that we did in Week 3. In today&#8217;s class, we delved deeper into the of game mechanics, focusing on creating enemies with dynamic behaviors and implementing collision detection and scoring systems.\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26160\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/Slide12-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/Slide12-1024x576.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide12-300x169.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide12-768x432.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide12-1200x675.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide12.jpg 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><strong>Step 4 \u2013 Enemy Properties and Movements<\/strong><br \/>This week, we stepped into the enemy creation. Through a series of challenges, we defined enemy characters and choreograph their behaviors using control flow concepts. By employing loops and conditional statements, we created enemy movement patterns and characteristics. This step not only serve as a platform to practice your programming skills but also sparked our creativity as we brought our enemies to life within the game world.<\/p>\n<figure id=\"attachment_26162\" aria-describedby=\"caption-attachment-26162\" style=\"width: 387px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-26162 size-full\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p3.png\" alt=\"\" width=\"387\" height=\"468\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p3.png 387w, \/hazlina\/wp-content\/uploads\/2024\/03\/p3-248x300.png 248w\" sizes=\"auto, (max-width: 387px) 85vw, 387px\" \/><figcaption id=\"caption-attachment-26162\" class=\"wp-caption-text\">Pseudocode of Activity 4<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26161\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/Slide13-1024x576.jpg\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/Slide13-1024x576.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide13-300x169.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide13-768x432.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide13-1200x675.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/Slide13.jpg 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><strong>Step 5 \u2013 Collision Detection &amp; Scoring<\/strong><br \/>With enemies &#8216;falling from sky&#8217;, the next challenge was to implement collision detection and scoring systems. Through careful application of control flow concepts, we simulated gravity and regulated the descent rate of falling enemies. Additionally, we developed algorithms to detect collisions between the player character and enemy entities, adding a layer of excitement and challenge to our game. Here, we compared the position of enemy and player to define collision.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26163\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p4.png\" alt=\"\" width=\"573\" height=\"358\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p4.png 573w, \/hazlina\/wp-content\/uploads\/2024\/03\/p4-300x187.png 300w\" sizes=\"auto, (max-width: 573px) 85vw, 573px\" \/><\/p>\n<p>As we fine-tuned our collision detection mechanisms, we celebrated each successful collision as validation that our code was correctly programmed. This step not only enhanced the gameplay experience but also sharpened our problem-solving skills as we navigated through the complexities of game development. The satisfaction of overcoming challenges and witnessing the seamless interaction between game elements served as motivation to push further in our Slider Game development journey.<\/p>\n<p><strong>Python Concepts<\/strong>\u00a0<br \/>Throughout today&#8217;s activities, we reinforced essential Python concepts, including operators and expressions, strings, functions, and control flow. By applying these concepts in the context of game development, we deepened our understanding and appreciation for their versatility and practical applications. From manipulating enemy properties to orchestrating complex game mechanics, our Python skills continue to evolve, empowering us to tackle increasingly sophisticated challenges.<\/p>\n<figure>\n<figure id=\"attachment_26158\" aria-describedby=\"caption-attachment-26158\" style=\"width: 840px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-26158 size-large\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p2-1-1024x434.png\" alt=\"\" width=\"840\" height=\"356\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p2-1-1024x434.png 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/p2-1-300x127.png 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/p2-1-768x326.png 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/p2-1-1200x509.png 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/p2-1.png 1899w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-26158\" class=\"wp-caption-text\">Week 3 In Class Activity<\/figcaption><\/figure>\n<\/figure>\n<figure><\/figure>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"745\" class=\"wp-image-26144\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033118006756797264835258-1024x745.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033118006756797264835258-1024x745.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033118006756797264835258-300x218.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033118006756797264835258-768x559.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033118006756797264835258-1200x873.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033118006756797264835258.jpg 1440w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26145\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033348492703344147171963-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033348492703344147171963-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033348492703344147171963-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033348492703344147171963-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033348492703344147171963-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1033348492703344147171963.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26148\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1035452553466734986573671-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1035452553466734986573671-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1035452553466734986573671-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1035452553466734986573671-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1035452553466734986573671-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1035452553466734986573671.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26146\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036188764147056422428017-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036188764147056422428017-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036188764147056422428017-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036188764147056422428017-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036188764147056422428017-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036188764147056422428017.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26147\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036248884068662816711116-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036248884068662816711116-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036248884068662816711116-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036248884068662816711116-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036248884068662816711116-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1036248884068662816711116.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26149\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1040467231916265696564099-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1040467231916265696564099-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1040467231916265696564099-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1040467231916265696564099-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1040467231916265696564099-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1040467231916265696564099.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26151\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041331217007564948172125-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041331217007564948172125-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041331217007564948172125-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041331217007564948172125-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041331217007564948172125-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041331217007564948172125.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" class=\"wp-image-26150\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041468588335480863380660-1024x768.jpg\" alt=\"\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041468588335480863380660-1024x768.jpg 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041468588335480863380660-300x225.jpg 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041468588335480863380660-768x576.jpg 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041468588335480863380660-1200x900.jpg 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/20240322_1041468588335480863380660.jpg 2000w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<p>&nbsp;<\/p>\n<p><strong>Looking Ahead<\/strong><br \/>As we reflect on the accomplishments of today&#8217;s class, let&#8217;s look forward to the endless possibilities that lie ahead. With each line of code we write and each challenge we overcome, we inch closer to realizing our vision for our Python game masterpiece. As we continue to explore advanced game mechanics and unleash our creativity, let&#8217;s embrace the journey with enthusiasm and determination.<\/p>\n<p>Stay tuned for more exciting adventures as we continue to push the boundaries of Python game development in BTE1522 Innovation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-26157\" src=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p1-1-1024x576.png\" alt=\"\" width=\"840\" height=\"473\" srcset=\"\/hazlina\/wp-content\/uploads\/2024\/03\/p1-1-1024x576.png 1024w, \/hazlina\/wp-content\/uploads\/2024\/03\/p1-1-300x169.png 300w, \/hazlina\/wp-content\/uploads\/2024\/03\/p1-1-768x432.png 768w, \/hazlina\/wp-content\/uploads\/2024\/03\/p1-1-1200x674.png 1200w, \/hazlina\/wp-content\/uploads\/2024\/03\/p1-1.png 1918w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><iframe loading=\"lazy\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/epMtTpQuQrE?list=PLXf1OUeUlWSydSwNzB6gb0ZpWX1jETIj7\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Hi BTE1522 Innovators, As we progress further into our journey of Python game development, let&#8217;s recap on the activities that we did in Week 3. In today&#8217;s class, we delved deeper into the of game mechanics, focusing on creating enemies with dynamic behaviors and implementing collision detection and scoring systems.\u00a0 Step 4 \u2013 Enemy &hellip; <a href=\"\/hazlina-blog\/2024\/03\/22\/bte1522-innovation-python-act-4-5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;BTE1522 \u2013 Innovation (Python) \u2013 Week 3 \u2013 Act 4 5&#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-26153","post","type-post","status-publish","format-standard","hentry","category-information","tag-academia-python-prog"],"_links":{"self":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/26153","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=26153"}],"version-history":[{"count":0,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/26153\/revisions"}],"wp:attachment":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/media?parent=26153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/categories?post=26153"},{"taxonomy":"post_tag","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/tags?post=26153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}