Totalscore doesn't need to be an instance variable and probably shouldn't be one.

Check out the section on 'Local variables' and 'Instance, class variables':
http://zetcode.com/lang/rubytutorial/variables/