Control Structures

Table of Contents



Iteration

I incoporated for loops to update the bullets and cookies positions in my game, which clearly updates the coordinates and follows the below functions such as destroy()

Image 8 Image 9



Conditionals

I implemented conditions to check if the player has met the win condition simultaneously while checking to verify if the score already has been processed

Image 8



Nested Conditionals

Utilized nested conditionals to check for the player’s coordinates and positions, to match with the gravity feature. Nested conditional allowed for checking that if the player exists through boolean, the next step is to check their height from the ground

Image 8