This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2012-06-30 14:09:39

DoowNimajneb
New Scratcher
Registered: 2012-06-27
Posts: 65

Re: Gliding Randomly! HELP!

Just realised, all things im wanting it to stop if touching them are black and only one other thing that I dont want is (But I can change that things colour)! So no I can use the:

if touching colour < (Black)  >
Now all I need you to answer is:
How can I get the coin to actually stop once its touched something.
And how can I get it to glide in a random direction?
Please answer soon as this project has to be in by the end of Monday!

Offline

 

#27 2012-06-30 14:12:42

DoowNimajneb
New Scratcher
Registered: 2012-06-27
Posts: 65

Re: Gliding Randomly! HELP!

Sorry, I don't know how to post/write the touching colour block, I meant to say:

If touching colour (Black).

Offline

 

#28 2012-06-30 14:36:07

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Gliding Randomly! HELP!

You can have it point to a random direction, so:

point in direction (pick random (0) to (360))
Then:
repeat until <touching color [#000000]?>
move (3) steps
end

Last edited by fg123 (2012-06-30 14:36:43)


Hai.

Offline

 

#29 2012-07-01 01:09:36

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Gliding Randomly! HELP!

DoowNimajneb wrote:

Just realised, all things im wanting it to stop if touching them are black and only one other thing that I dont want is (But I can change that things colour)! So no I can use the:

if touching colour < (Black)  >
Now all I need you to answer is:
How can I get the coin to actually stop once its touched something.
And how can I get it to glide in a random direction?
Please answer soon as this project has to be in by the end of Monday!

Aghhh, Doownimajneb, I wrote a few scripts on here over the last 2 days, are they what you need? I will post it again...

Here is a script for your gliding coin:

when I receive [broadcasted thing v]
repeat until <touching [board v]?>
glide (1) secs to x: (Pick random (1) to (360)) y: (pick random (1) to (360))
end
hide
Here is a script to stop once it touches a coin:
when I receive [broadcasted thing v]
forever
if <touching [sprite v]?>
hide
These scripts will allow your coin to glide randomly, and once it touches the sprite it will stop..
Is this what you need?
Dan Jones  smile


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

Board footer