Add points and update the objective
Under the Use action group, Add Next Action appends another step. Actions run from top to bottom. Build the sequence below, apply the Inspector and save the project.
| Step | Action | Settings |
|---|---|---|
| 1 | Set Variable | Variable clock_wound; Value true. |
| 2 | Change Variable | Variable score; Operation add; Value 10. |
| 3 | Change Variable | Variable attempts; Operation add; Value 1. |
| 4 | Set Variable | Variable objective; Value "The clock is running." |
| 5 | Show Message | Text: You wind the clock. Score: $$score. Attempts: $$attempts. |
Figure 13. Change Variable adds to the score. It does not replace it with the reward amount.
Values in these general action fields#
| Intended value | Enter in an action-list Value field |
|---|---|
| Boolean | true or false |
| Number | 10 or 2.5 |
| String | "The clock is running." |
| Array | ["clock diagram", "winding socket"] |
The table uses JSON value notation. Ordinary unquoted words can fall back to text, but quotes make String values unambiguous here. For Show Message’s dedicated Text / Message field, type the sentence normally. For null, use the explicit options described in Chapter 6.
