Thanks I seem to have found the answer. I simply took out the « var » in the init function and everything seems to work now.
I am a teacher and I am making a small interactive game for the students to review the novel Dr. Jekyll and Mr. Hyde. Most of it is done but I wanted to let them know at the end how they had done, good answers versus bad. I thought that I’d use a counter for both like x = ++x but I can’t seem to make it work across all the functions. All I get is a NaN as an answer. Here are examples of the functions.
Thanks I seem to have found the answer. I simply took out the « var » in the init function and everything seems to work now.