Combining Sensing and Conditionals

Topic

Combining Sensing and Conditionals

Topic Progress:

The previous two lessons taught us about the blocks that can be combined to allow code to react to certain situations or conditions.

You can use a touching mouse pointer block to make the sprite move to a random position every time the mouse pointer touches the sprite.

In the block of code, we need to put the if statement inside of a forever loop so that the code is always checking if the mouse touches the sprite. Otherwise, it would check once as soon as the green flag is clicked and would then stop checking.

You can try this code by clicking on the link https://scratch.mit.edu/projects/346208995/editor/

Try changing the code in the link to do something else such as saying a message when the sprite moves or changing to a different costume

Course Discussion

@

Not recently active