🧠Concept
Pick the right answer.
high-scores list. The average of that list is far below the designer's target. What does this tell the designer?high-scores was typed as 3120 instead of 312. Before trusting the average, what should you do?average variable on the stage with show variable?speed-max only when the average is below the target AND the list holds more than three scores. Why does it also count the scores?speed-max. Why is that better?👀Code Reading
Look at the blocks. Predict what happens.
high-scores holds [300, 200, 260, 140]. What does the average variable show after this runs?set [total v] to (0) set [index v] to (1) repeat (length of [high-scores v]) change [total v] by (item (index) of [high-scores v]) change [index v] by (1) end set [average v] to ([floor v] of ((total) / (length of [high-scores v]))) show variable [average v]
average is 210, target is 250, speed-max is 5, wave-growth is 2, and high-scores holds 5 scores. What are the two settings after this runs?if <<(average) < (target)> and <(length of [high-scores v]) > (3)>> then
if <(speed-max) > (3)> then
set [speed-max v] to ((speed-max) - (1))
end
if <(wave-growth) > (1)> then
set [wave-growth v] to ((wave-growth) - (1))
end
endhigh-scores was recorded wrong. What does this block do?replace item (4) of [high-scores v] with (312)
average is 260, target is 250, and high-scores holds 5 scores. What happens when this runs?if <<(average) < (target)> and <(length of [high-scores v]) > (3)>> then set [speed-max v] to ((speed-max) - (1)) end
when I receive [game-over v] add (score) to [round-2 v] change [plays v] by (1)
🐛Find the Bug
Something is broken. Pick the fix.
The average of high-scores is right for five scores, but after one more game of Space Patrol is played the average is wrong. The averaging block is shown below. What is the bug?
set [total v] to (0) set [index v] to (1) repeat (length of [high-scores v]) change [total v] by (item (index) of [high-scores v]) change [index v] by (1) end set [average v] to ([floor v] of ((total) / (5))) show variable [average v]
🛠️Build It
Pick a level. Build it. Check the boxes.
Average the playtest scores.
More
Open your Space Patrol project. Add four playtest scores to the high-scores list with add. Under a when [t] key pressed hat, loop over the list to add every score into a total variable, set an average variable to the floor of total divided by length of [high-scores ▾], and show variable the average.
Done when
Pressing T shows an average variable on the stage that matches the scores in the high-scores list, and it still matches after another score is added.
Fix the bad score, average again.
More
Add data cleaning to the EASY averager. Put one wrong score in the list on purpose (for example 3120 instead of 312). Press T and read the bad average, then use replace item to clean the entry and press T again.
Done when
The first average is clearly too high because of the bad score. After replace item cleans the entry, the recomputed average is sensible. Both values are seen on the stage while testing.
Lower the settings if scores are low.
More
Complete the refinement loop from MEDIUM. Store the enemy speed limit in speed-max and the wave growth in wave-growth, and use them in the Chapter 14 enemy scripts. After averaging, use an if / else whose test is average < target AND the list holding more than three scores; inside it lower speed-max only while it is above 3 and lower wave-growth only while it is above 1. Then collect a fresh round of scores into a round-2 list on game over.
Done when
The enemy scripts read both settings. Pressing T lowers both settings only when the average is below the target and there is enough data, and keeps them otherwise. Playing again fills round-2 with new scores.
Review the student's project, then check each thing they did.
Project Evaluation
0 of 5 ticked
💬Talk About It
Present your project to your teacher or a classmate.
- 1️⃣Show a friend your Space Patrol tuning script running.
- 2️⃣Point to your
show variable [average]block and yourreplace itemblock. - 3️⃣Say one thing each block does for the game.
Watch the student present, then check each thing they did.
Presentation Checklist
0 of 4 ticked
📤Submit
Send your results to your teacher and parent.
0 of 0 answered