Discuss Scratch

Landrover110
Scratcher
100+ posts

How can i get a sprite to

How can i get a sprite to stop if it is touching another sprite for example if I have a fish and a piece of fish food fell from the top of the screen to the bottom and you tell the fish to glide forever to the x and y position of the food and when it got to the food it must switch to the costume open mouth
and broadcast eaten when the food receives eaten it must hide

But the problem is that when the food is eaten the fish goes crazy

how would you get the fish to swim away once it has eaten the food and go do something else and forget about the eaten food
what I want is the fish to eat the falling food and then swim away

best regards

Too much linux
>>>>>>See my projects here <<<<<<
drmcw
Scratcher
1000+ posts

How can i get a sprite to

If you have a forever block containing glide to x,y of fish food then yes it will go mad when the food is hidden. There are many ways to solve this. You need to break the forever block, so it only goes to the food when the food is not eaten, otherwise it glides elsewhere. You could use a variable and set it to 1 when eaten and 0 when not eaten and have that as an if then else block inside the forever. Difficult to make suggestions without seeing the actual project but hopefully that may point you in the right direction.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
Landrover110
Scratcher
100+ posts

How can i get a sprite to

thanks will try that

Too much linux
>>>>>>See my projects here <<<<<<
Landrover110
Scratcher
100+ posts

How can i get a sprite to

Thanks that worked I made a varible and the fish wold forever go to the food if the varible is 0 and when the fish ate the food the varible changed by 1
and this fish did not follow the food anymore
thankks again

Too much linux
>>>>>>See my projects here <<<<<<
drmcw
Scratcher
1000+ posts

How can i get a sprite to

Well done. Glad it helped.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?

Powered by DjangoBB