Thursday, September 25, 2014

Variable Roles

3.a)  Cat and Wall
3.b) Only "Cat" has a script, and it only has one.
4) Really all it does is bounce the cat back and forth.
5) Because then it becomes a variable instead of just a number, and that can be helpful.
6) I decides which way its facing, and therefore which way it moves.
8) "Cat" does not move.
9) Because it has to go along with what has just happened (the most recent) so it can do its job. "Cat" hits the "Wall" or the edge of the screen and that puts in a new number for "Direction", and it has to keep with that most recent number until it hits something else.
13) The "Accumulator" is new
14) I think it's changing the the accumulator when you click the "Cat", but I'm not sure if it has a sort of pattern.
15) It appears to give negative "points" for whenever you click the "Cat"
17) it keeps track of the accumulator

Conclusion
1) It can make things easier to control when you have variables, even if they are fixed at one number.
2) Ok to be be honest I'm not exactly sure what this is asking
3.a) Pretty much any game or app that keeps track of a growing score
3.b) the accumulator in something like this is what keeps track of your score as you get more or less points.

No comments:

Post a Comment