{"id":56,"date":"2022-11-22T22:07:42","date_gmt":"2022-11-22T22:07:42","guid":{"rendered":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/?p=56"},"modified":"2022-11-22T22:07:42","modified_gmt":"2022-11-22T22:07:42","slug":"week-5-development-journal","status":"publish","type":"post","link":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/2022\/11\/22\/week-5-development-journal\/","title":{"rendered":"Week 5: Development Journal"},"content":{"rendered":"\n<p>This week continued on with the focus on the development of the game.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"367\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Game-end-dev-week-5.gif\" alt=\"\" class=\"wp-image-61\"\/><figcaption class=\"wp-element-caption\">This shows what the game\/ gameplay looks like at the end of the week which includes spawning multiple enemies over the just one before, animations to movement and combat including killing of enemies and player health\/ dying. This is shows that I had enabled the debug from this point on (the boxes around the player and enemies). <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"661\" height=\"538\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-4-create-and-update-changes.png\" alt=\"\" class=\"wp-image-62\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-4-create-and-update-changes.png 661w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-4-create-and-update-changes-300x244.png 300w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><figcaption class=\"wp-element-caption\">This is the changes done to the create and update function within the HTML file of the game the wasn&#8217;t any changes to the preload so I didn&#8217;t include it here. Changes include the player create function of the player JS file is now equal to player which is then passed on to the enemy create function in the enemy JS file. The changes to the update function is more of just passing the game instance to the different functions of both the player and enemy JS.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"460\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-preload-and-create.png\" alt=\"\" class=\"wp-image-63\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-preload-and-create.png 900w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-preload-and-create-300x153.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-preload-and-create-768x393.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><figcaption class=\"wp-element-caption\">The player preload and create functions had a few changes to them which for preload was just preloading more of the player specific assets. For the player create it was adding the keyboard input of space for attacking, the player down animation and returning the player.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"651\" height=\"821\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-movement-animations.png\" alt=\"\" class=\"wp-image-64\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-movement-animations.png 651w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-movement-animations-238x300.png 238w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><figcaption class=\"wp-element-caption\">The code for all the directional movement animations.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"878\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-animations.png\" alt=\"\" class=\"wp-image-65\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-animations.png 712w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-animations-243x300.png 243w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><figcaption class=\"wp-element-caption\">The code for all the attack animations for each direction.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"394\" height=\"179\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Checking-game-over-health-ui-and-player-invuln.png\" alt=\"\" class=\"wp-image-66\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Checking-game-over-health-ui-and-player-invuln.png 394w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Checking-game-over-health-ui-and-player-invuln-300x136.png 300w\" sizes=\"auto, (max-width: 394px) 100vw, 394px\" \/><figcaption class=\"wp-element-caption\">These are the more minor changes to the player update function including the detecting if the game is over, the player health UI in the update function for updating any changes to player health throughout the game and the player invulnerability. <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"651\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-controller-and-game-over-calling.png\" alt=\"\" class=\"wp-image-67\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-controller-and-game-over-calling.png 823w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-controller-and-game-over-calling-300x237.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-attack-controller-and-game-over-calling-768x607.png 768w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><figcaption class=\"wp-element-caption\">These are the rest of the changes to the player update function which is mostly the addition of calling attack animations through the space key being pressed. Also the check if the player health is 0 or less for setting game over true for the check previously. Finally the function for resetting the current animation so it doesn&#8217;t get stuck in an animation for example getting stuck in an attack animation. <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"348\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-enemy-create-function-changes-variable-enemies.png\" alt=\"\" class=\"wp-image-68\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-enemy-create-function-changes-variable-enemies.png 732w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-enemy-create-function-changes-variable-enemies-300x143.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><figcaption class=\"wp-element-caption\">For enemy JS there were no changes to the preload function but was for the create and also the addition of the enemies variable which was used for handling the enemies group. The enemy create function has been completely reworked to use the enemies group to allow spawning of multiple enemies and using that for spawning 3 enemies. Also passing each enemy in the enemies array health based on the enemy health variable from before and an invulnerability timer. Also adding overlap to the player and enemies.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-enemy-overlap-attacking.png\" alt=\"\" class=\"wp-image-69\" width=\"604\" height=\"344\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-enemy-overlap-attacking.png 604w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Player-enemy-overlap-attacking-300x171.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><figcaption class=\"wp-element-caption\">This is the function called when the player and enemy overlap first we have the checking if the player is attacking the enemy through checking if the player animation includes the word &#8220;Attack&#8221; which if it does and the enemy being attacks invulnerability equals 0 then the enemy takes damage and gain invulnerability. If the player isn&#8217;t attacking then it is checking if the player is invulnerable if they&#8217;re not then the player takes damage and gains invulnerability. Finally for the purposes of testing while developing logging the player and enemy health any time they overlap.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"819\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Enemy-movement-animations.png\" alt=\"\" class=\"wp-image-72\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Enemy-movement-animations.png 637w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Enemy-movement-animations-233x300.png 233w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><figcaption class=\"wp-element-caption\">The code for all the enemy directional movement animations.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"355\" height=\"916\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Enemy-update-function.png\" alt=\"\" class=\"wp-image-73\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Enemy-update-function.png 355w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Enemy-update-function-116x300.png 116w\" sizes=\"auto, (max-width: 355px) 100vw, 355px\" \/><figcaption class=\"wp-element-caption\">There have been some changes to the update function where it iterates everything for all the enemies where it sets enemy to = child of enemies so most the logic can stay the same for movement over how it was before and taking away enemy invulnerability if the enemy has any.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"690\" src=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Trello-1024x690.png\" alt=\"\" class=\"wp-image-75\" srcset=\"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Trello-1024x690.png 1024w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Trello-300x202.png 300w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Trello-768x518.png 768w, https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2022\/11\/Week-5-Trello.png 1114w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The Trello board at the end of the week.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This week continued on with the focus on the development of the game.<\/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-56","post","type-post","status-publish","format-standard","hentry","category-devlog"],"_links":{"self":[{"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/56","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=56"}],"version-history":[{"count":4,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/georgebaker.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}