hi,
i'm trying to create a scratch project to demonstrate the different strengths of magnets. i need to make a magnet that attracts only a certain amount of paper clips, then another magnet that attracts either more paper clips or less paper clips than the first magnet. But i don't know how to limit the number of paper clips that could be attracted to each of the magnets. Can anyone help?
Offline
just make some paperclips go to one magnet and the rest of the clips go to the other magnet, every paperclip you want to make to go to magnet one u say
[blocks]<when green flag clicked>
<point towards( magnet1)>
<move(<{ magnet 1 velocity }> )steps>
[/blocks]
and for the other paper clips that has to go to magnet 2
[blocks]<when green flag clicked>
<point in direction( magnet2 )>
<move( <{ magnet 2 velocity }> )steps>[/blocks]
Then on the stage make a script
[blocks]<when green flag clicked>
<forever>
<change{magent 1 velocity}by( .1 )>
<change{magnet 2 velocity}by( .1)>[/blocks] (more ore less depending on the accelaration you want)
Offline
One way that might work: Have each magnet keep a count (in a variable) of how many paperclips it has touching it so far and also have a variable for how many it is allowed to attract (it's maximum limit). That would be in another variable. Then, each paper clip can check the magnet to see if it is full yet before deciding whether to go to the magnet or not. The key thing here though is you have to slow down the response of the paper clips, if they jump at the magnet all at the same time, it's probably not going to work right. So you have to space them out.
To space them out, have each paper clip wait a short random amount of time before looking at the magnet. Then, they won't all jump at once. I hope that helps...let me know if you want me to build a demo.
Offline
Paddle2See wrote:
One way that might work: Have each magnet keep a count (in a variable) of how many paperclips it has touching it so far and also have a variable for how many it is allowed to attract (it's maximum limit). That would be in another variable. Then, each paper clip can check the magnet to see if it is full yet before deciding whether to go to the magnet or not. The key thing here though is you have to slow down the response of the paper clips, if they jump at the magnet all at the same time, it's probably not going to work right. So you have to space them out.
To space them out, have each paper clip wait a short random amount of time before looking at the magnet. Then, they won't all jump at once. I hope that helps...let me know if you want me to build a demo.
what he said...
Offline