We had some useful sessions on basic object types in coding and how they’re represented in javascript. I created an object that contained a few attributes about myself represented as strings, boolean and integers as a refresher.
I created a flowchart to represent the gameflow of the dark age of Age of Empires 2; this contained some iterative loops and a lot of conditional statements. It was a useful example of an application of decomposition as I only viewed the user’s choices in relation to the food resource. The ideas present could have been expanded upon by including wood and building production, which would require some restructuring to remain presentable to readers. They could potentially be implemented as functions.
The second flowchart related to guard movement went very smoothly – I created a variable to detect the direction the guard is pointing and used this to alter their position every game step. An iterative check to their relative location to the player was used to check whether they give chase or attack them, and when these checks are no longer satisfied the loop will break and return to the movement blocks.
During the task where we were editing a canvas app in javascript, I experimented with the random function to create a unique hex code for every shape drawn to create a rainbow colour in the palette. I also used the drawImage() function to allow image generation as a unique shape choice, using the root folder of the code as the image source.