Discuss Scratch

footsocktoe
Scratcher
1000+ posts

Make an unplayer controlled sprite switch directions

zp100 wrote:

Hmm, good point…
You could create a sprite. In the scripts I'll call it “sprite 2.” Have it hide when flag is clicked. When the first sprite needs to move somewhere, broadcast “move.” Have it go to wherever you want the original sprite to glide to.
when I receive [move v]
go to x: () y: ()

For the original sprite:
when I receive [move v]
wait (0.001) secs
point towards [sprite 2 v]
repeat ((distance to [sprite 2 v]) / [x])
move [x] steps
end
go to [sprite 2 v]

Make “x” whatever number you want. It represents the speed that your sprite moves.

Try this and tell me if it works.


How is creating a second sprite and using broadcast blocks any simpler or more efficient than the solution already posted on Jan. 11, 2016 22:30:42 ?


SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!

TheCentipede
Scratcher
100+ posts

Make an unplayer controlled sprite switch directions

I think this has been solved

You should definitely feel mediocre at best compared to TheCentipede , DO NOT FEEL BAD

Powered by DjangoBB