{"id":57,"date":"2022-11-23T00:53:15","date_gmt":"2022-11-23T00:53:15","guid":{"rendered":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/?p=57"},"modified":"2022-11-23T00:53:40","modified_gmt":"2022-11-23T00:53:40","slug":"week-6-developer-journal","status":"publish","type":"post","link":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/2022\/11\/23\/week-6-developer-journal\/","title":{"rendered":"Week 6: Developer Journal"},"content":{"rendered":"\n<p>This week continued on with purely development work of the project.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"197\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-player-preload.png\" alt=\"\" class=\"wp-image-77\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-player-preload.png 924w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-player-preload-300x64.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-player-preload-768x164.png 768w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><figcaption class=\"wp-element-caption\">While rather a small change the attacking assets being loaded has been changed so instead of using a whole sprite sheet as it did before. Instead using one frame of the animation with the height and width of it for more accurate attacking over how it was before with the oversized area of the animation causing misalignment to where attacks that looked like should hit didn&#8217;t before.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"267\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-1-1024x267.png\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-1-1024x267.png 1024w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-1-300x78.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-1-768x200.png 768w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-1.png 1036w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">While the logic for spawning the enemies of the first wave has not changed it has been changed to being controlled by a wave variable which increases when all enemies are killed to start the next wave or for call back to wave 1 if the player dies. Also added a total number of enemies to it to keep track of how many enemies are alive and once reaching 0 starting the next wave. <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"552\" height=\"229\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-2.png\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-2.png 552w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-2-300x124.png 300w\" sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><figcaption class=\"wp-element-caption\">For wave 2 and beyond the logic for spawning the enemies had to change to accommodate what I wanted to do as with the implementation used for wave 1 it was only possible to spawn 1 row of enemies. This does this through a for loop and creating enemies at each desired position (same as the spawning for the previous level + same pattern for bottom of the screen).<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"485\" height=\"728\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-3-5.png\" alt=\"\" class=\"wp-image-80\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-3-5.png 485w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Wave-3-5-200x300.png 200w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><figcaption class=\"wp-element-caption\">Waves 3-5 (the rest of the waves) all have the same spawning of the enemies using the same logic as the previous wave and 2 extra enemies on the left and right side of the player.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"80\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Health-collectible-group-collision-with-player.png\" alt=\"\" class=\"wp-image-81\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Health-collectible-group-collision-with-player.png 546w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Health-collectible-group-collision-with-player-300x44.png 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><figcaption class=\"wp-element-caption\">Creating the group for the health collectible and overlap\/collision with the player.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"464\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-enemy-changes-1-1024x464.png\" alt=\"\" class=\"wp-image-83\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-enemy-changes-1-1024x464.png 1024w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-enemy-changes-1-300x136.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-enemy-changes-1-768x348.png 768w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-enemy-changes-1.png 1261w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The first change to the attacking between the player and enemy overlap function is the enemy dying and taking away from the total number of enemies has been moved from the update function to here with the addition of the new health consumable being created at it&#8217;s position. Along with this is when the total enemies reaches 0 incrementing the wave number and calling the enemy create function to call the next wave. Also a minor change to the invulnerability of the player being increase from 60 to 240.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"904\" height=\"309\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-healing.png\" alt=\"\" class=\"wp-image-84\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-healing.png 904w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-healing-300x103.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Player-healing-768x263.png 768w\" sizes=\"auto, (max-width: 904px) 100vw, 904px\" \/><figcaption class=\"wp-element-caption\">The function called when the player overlaps\/collides with the health consumable. This adds 2 to the health of the player if adding it won&#8217;t go above 100 health otherwise it will set the player health to 100.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"788\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Trello-1024x788.png\" alt=\"\" class=\"wp-image-85\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Trello-1024x788.png 1024w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Trello-300x231.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Trello-768x591.png 768w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-6-Trello.png 1110w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The Trello at the end of the week. <\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This week continued on with purely development work of the project.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-devlog"],"_links":{"self":[{"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":3,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":87,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions\/87"}],"wp:attachment":[{"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}