Today in class we added scoring to our first game project.
To add scoring,
1) Open up the Orange Variables block set
2) Click the grey ÒMake a VariableÓ button. ˆ
3) Type the name ÒScoreÓ into the box that pops up.
4) The Variable block will now look like this. >>
5) Grab the ÒSet Score to 0Ó block and drag it under the yellow ÒGreen FlagÓ control block at the top of your main spriteÕs script tab.
6) Every time someone gets an answer correct in your quiz by answering ÒyesÓ or ÒnoÓ, add the ÒChange Score by 1Ó
Here is an example of what one quiz question might look like. You will want to have at least 3 quiz questions.
At the end of the quiz you can add code like the code below to decide what will happen if the person gets a perfect score (or not!)
Practice making a new scored quiz at home!
If you have email and want to ask me anything, you can email me at alfiawallace@yahoo.com See you next week! Keep on Scratching! J ~ Mrs. Wallace Copyright 2012 Alfia Wallace - Back to Plumsite |