So during this recent assignment (which hasn’t been a success for me yet), I partially reconfigured some of the skeleton code Dr. Delwiche gave us in class. One of the things that I figured out was that the init function seems to be missing a function call to the calorie-updating function. So this meant that my program would (if I am not mistaken) only run up till init and nothing more. So I nested my calorie-updating function call inside the init.
The other problem I experienced was my calorie tallying value. It just wouldn’t add. Even after i declared them correctly as integers, added a trace calories on my MouseEvent click functions, my calorie value would still remain as zero.
But the biggest concept that I really tried but couldn’t understand is using the “for” statement to create a loop which will continue to check if total calories is exceeding 3000. I was also confused how to setup a “for” loop that would do this efficiently. Whenever I tested my animation with this loop, my animation would just jump straight to the end result page without me clicking any food items, which are attributed with individual calorie integer values.
Overall, I spent a total of two and a half hours on this assignment and really hope that I can resolve these issues by next class.
I am glad that we are finally learning how to incorporate sound.