Try using a pick random () to () block instead of numbers. Try changing the values of colors, sizes, and ghost effects etc. Some of the dots might stay on the project until they touch a corner.Ī project with a pen mouse trail can be seen here. To make a mouse trail drawn with pen, use these scripts: The Pen blocks can be used to make mouse trails. See Customizing for help on editing this script.Ī project with sprite mouse trails can be found here. Move (distance to (mouse-pointer v)) steps To begin to make a mouse trail, start with this script. You can make the sprites do whatever you want. There are many ways to edit a mouse trail, but this is a basic template. If this is done, make sure to include a script that tells the clones to change to a random costume. This will make the mousetrail more colorful and creative. If you want, you can give the sprite different costumes for more variety. You can find some good sprites in the sprite library. It can be anything, but it shouldn't be too big. The part of the code that animates the sparkles starts from line 140 - try tweaking some of that code.įor example on line 143, I changed it to stary+=1+Math.Important Blocks to Use point towards (mouse-pointer v)īefore you can start your mouse trail, you need to pick out a shape, even if it is just a simple colored circle. Hope it helps! I think tinkering with other peoples scripts like this is a great way to start to understand coding. If you’re only just learning JavaScript it’s probably going to be beyond your capabilities trying to change the effect to something specific, but you could try playing with other values and seeing what happens. So for instance, if you changed every use of sparkles to circle you’re only really changing a label, not changing what the code does. There’s not much point changing variable names because they are really just labels. I’m not clear what the circle effect you were hoping to see was but no, this isn’t at all the correct way, sorry!Īll you really did by changing sparkles to circle the first time was effectively set the number of falling sparkles to zero, which is why they stopped falling.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |