Discuss Scratch

jess3993
New to Scratch
7 posts

Making a sprite move randomly.. pleaseeeee help me ..

I've made my background using vectors and I want to make some of my sprites move randomly and constantly, I have tried to do this by using the script: when (flag clicked) forever- rotate 15 degrees-move 10 steps- if on edge bounce. However it does not work due to my vector drawn background, they bounce off random things at a really really high speed and it just does not work . How can I fix this problem ? I know that the script definitely works because I've tried it on one with no vector drawn background!
Thanks
Jess
JAVAProgramming
Scratcher
100+ posts

Making a sprite move randomly.. pleaseeeee help me ..

You might want to try
 (pick random () to ()) 
.

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
drmcw
Scratcher
1000+ posts

Making a sprite move randomly.. pleaseeeee help me ..

jess3993 wrote:

I've made my background using vectors and I want to make some of my sprites move randomly and constantly, I have tried to do this by using the script: when (flag clicked) forever- rotate 15 degrees-move 10 steps- if on edge bounce. However it does not work due to my vector drawn background, they bounce off random things at a really really high speed and it just does not work . How can I fix this problem ? I know that the script definitely works because I've tried it on one with no vector drawn background!
Thanks
Jess
Can you share the project as the script you mention will only bounce off the edge of the screen, nothing else. So has nothing to do with vector backgrounds.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
scubajerry
Scratcher
1000+ posts

Making a sprite move randomly.. pleaseeeee help me ..

I suspect your costumes are not centered. But as previously said, if you need more help, please share your project.
MCAnimator3D
Scratcher
500+ posts

Making a sprite move randomly.. pleaseeeee help me ..

This is because of a Vector pixel. Go to your sprite's costume. Have the selection tool selected. Select the top left corner of the costume. You will notice that there is a random pixel you didn't put there. Just hit the delete key to get rid of it. That should solve your problem.


scratch
GadgetAndyMan
Scratcher
100+ posts

Making a sprite move randomly.. pleaseeeee help me ..

Having a vector drawn background shouldn't effect anything. I deleted your bitmap background and the empty white one and it worked with the vector drawn one

Latest project updated: X-Y Coordinates Challenge - 14 Jan 2014: Various improvements.

My Likes Studios [ Animation | Art | Education | Games | Simulation | Stories ]
Please take a look and follow any studios that interest you with the projects I am adding.
TechnolgyGuy
Scratcher
100+ posts

Making a sprite move randomly.. pleaseeeee help me ..

Try
(pick random (some random number) to (some even more random number))

when green flag clicked
forever
be awesome
end

Powered by DjangoBB