Step 4: Medium Target Hit Message/Score/Reset

Goal:


The code for the Medium Target is very similar to the Easy Target code except for two small differences.

The first difference is that the number of points received is higher than before because the Medium Target is harder to hit than the Easy Target

The second difference is that the position of the Medium Target is different from the Easy Target which means we need to change the X and Y values in our code.

Steps:

    1. Click on the “Medium Target” sprite
    2. From Events, place a when I receive block and add a new message called “MediumScored!
    3. From Control, place a repeat block and set it for 2 times.
    4. From Looks, place a next costume block inside the repeat block.
    5. From Control, place a wait block and set it for 0.3 seconds
    6. From Looks, place a hide block
    7. From Variables, place a change Score: by 3 block
    8. From Motion, place a go to X: 220 Y: -180 block
    9. From Control, place a repeat block
    10. From Operators, place a pick random 25 to 75 block and place it inside the repeat block
    11. From Motion place a change x by 5 block
    12. From Motion place a set y to 60 block and place it outside the repeat block
    13. From Looks, place a next costume block.
    14. From Looks, place a show block.

Code: