This code has been designed to be used with Lesson 2 of Programming essentials in Scratch – part II
Credit to @catbee12345 and @ncce_codefiles