Remember the cat we used in our last program?
It's called a "Sprite".
Now, let's add a mouse sprite.
In the sprites section, click on the button "Import sprite"
Now, go find the mouse sprite.
At the beginning of the game, we want the mouse to appear at a random spot, so lets use a "random" block.
Drag a "When flag clicked" block in the script field and below that, put a "go to" block.
If we want to change it's horizontal position, we better use the part that says "x".
In the "Operators" section, drag that random block into the "go to" block.
Remember to drag it in the "x" :-).
since the far left side of the screen is "-240" and the far right is "240", we change the minimum and maximum values to those. Your code should now look like this:
Press the flag
Why don't you do the same thing with "y"?
For "y", the minimum and maximum should be "-180" and "180"
Nice. I think people will gain a lot of knowledge from this. My blog.. It's really just what I am doing. I think you have a better blog.ReplyDelete
Thank you, and to make your blog better, just think of it from your readers point of view :)Delete
Thanks, I will try that.Delete
Nice job codegirl! Your explanations were very clear on how to make a mouse and use Scratch. I will have to try this out some day soon. Keep up the great work.ReplyDelete
I hope you try it; it's fun!Delete