fcomputer wrote:
Im so confused 'bout my aquarium project .
I have a diver and some fish,
here is the problem, when the diver move closer to the fish, the fish move to avoid the diver. how to do that ?
help me please![]()
should the fish forever avoid the diver or should they allow the diver to catch up to them?
Offline
4lover wrote:
fcomputer wrote:
Im so confused 'bout my aquarium project .
I have a diver and some fish,
here is the problem, when the diver move closer to the fish, the fish move to avoid the diver. how to do that ?
help me please![]()
should the fish forever avoid the diver or should they allow the diver to catch up to them?
yes. forever avoid the diver...
Offline
You'll have to make the fish move it the opposite direction of its relation with the diver. In Scratch blocks, you could try this:
[blocks]
<forever>
<point towards( diver
<turn cw( 180 )degrees>
<move( 5 )steps>
<end>
[/blocks]
Last edited by LS97 (2011-09-21 12:01:17)
Offline
LS97 wrote:
You'll have to make the fish move it the opposite direction of its relation with the diver. In Scratch blocks, you could try this:
[blocks]
<forever>
<point towards( diver
<turn cw( 180 )degrees>
<move( 5 )steps>
<end>
[/blocks]
Thanks , but itsn't work well ..
the fish move into the edge and get error
Offline
Well I think I have a good solution except for a couple questions do you want the fish to be covering the entire screen or just a straigh line and what are the controls for the diver
Offline
OK, I got a better version. How about,
Offline
LS97 wrote:
OK, I got a better version. How about,
http://dl.dropbox.com/u/11532575/forums … ceMove.gif
It might be a good idea to detect the distance to the edge, then have the sprite begin turning away from the wall when it gets too close so it doesn't collide with it.
Also moved to All About Scratch, the forum for Scratch programming questions.
Offline