[Coding Diaries]: Adding Points on a Key Press
Diving into if-else statements. This one's a doozy:
I have to add 10 points every time I hit the spacebar. It seemed simple enough at first: if I hit space, I add 10 points. Then I realized I cannot just put <+10 points> directly as one line of code; it had to be a full statement, with an equal sign or a parenthesis. So, I declared a variable for the points to add, appended it to the points in the Update method, and then printed the new points score.
Oh, what stupidity! I was too flowery with my sentence when I could have just made it so much simpler:
...just friggin add 10 then print.
Hahahahahahahahhaahhahahahaha!
This is my villain origin story :')
~~~
EDIT
OMG, it gets worse!
You can add 10 points without needing to define the variable; you simply add <=> to indicate that it's a full equation.












