5. Implementation : 3
As always I begin by stating the 'state' of my productivity, which quite surprisingly was at its highest today. A lot of things were checked off my list. I finally almost finished a rough prototype of the basic concept of the game. I was able to convert the raw data ( present in code) to a visual much easier to read representation.
Each attribute/detail of the person which was randomly generated and stored in a global variable, is now used by ($Label) to display in the form of text. Furthermore since they are global variables, I was able to utilise them to form conditions, thus allowing me to make decisions that abide by rules.. for ex :
-> no person over the age of 40 can be given the antivirus for free..
by accessing the global 'age' variable whose content was randomly generated by what I call RGS or Random.Generation.System. Now that I access the variable I can use it in the 'if' statement.
By making two buttons, one green and the other red, I provide the player the opportunity to decide between giving the antivirus for free(green) and for a price(red)
If the player sells the antidote for free to any person whose age is above 40, A temporary label says 'YOU ARE WRONG'
The if condition is as follows:
Green button pressed...
If age > 40:
Label.text = "You are wrong"
Else:
Label.text = "You are right"
And vice versa for the RED BUTTON. I also added the ability to implement multiple conditions in the code.
That is all...
No comments:
Post a Comment