Saturday, February 8, 2020
Lab 4 Reflection - Part 2
This blog post is a follow up from the previous post called "Lab 4 Reflection - Part 1". It is highly recommended you read that post prior to this one so you have context on what this entry is all about. This post will cover my completion of "option 4" for lab 4 including a brief breakdown on how the code works.
Code link: https://gist.github.com/Megawats777/30f5b436042aff848263d483ebaf051d
To describing the code briefly it is best to explain the general flow of it all. When the program first boots up I first initialize the variables "colour" and "colourNameIndex" to zero as well as draw the text menu for colour selection. Afterwards, I start the whole input loop where I check whether the up or down arrow keys have been pressed. These keys will control the change of the colour shown on the bitmap display. After the appropriate keys are pressed the "colour" variable will have it's value changed and that variable will be used to draw the selected colour on screen. Once the colour on screen is drawn I then update the text colour list to show which colour is selected. I represent the selected colour on the text list via reversing the video on the selected colour name. Finally, once all of this is done I go back to checking for input from the user.
See you in the next part.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment