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

#1 2012-07-08 10:40:45

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

HELP, DUE IN MONDAY!!! broadcasting problem

I am making a carnival game in scratch, and my problem is when I choose one of three shooter sprites and a coin inside it points towards the mouse pointer, you then click on one of five sprites (called 'walls') and it is supposed to glide towards it then point in a random direction then go forwards whichever way its facing.
I think I know how to do everything apart from how to make one of three coins to go to one of the 'walls' because I will probably have to use broadcasting (please let me know if there is another way), and I am struggling on what to do with it because if the wall broadcasts a load of things at once when it is clicked, all the coins will come to it so I need to know how to seperate the broadcasts and only broadcast a certain broadcast when a certain shooter has been clicked.
Once again, THIS IS DUE IN ON MONDAY SO PLEASE HELP!!
Please post if you dont understand, have a suggestion, have a definate solution or anything else, I will be happy to answer any questions as well!
Thanks again!,
DoowNimajneb

Offline

 

#2 2012-07-08 11:14:07

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: HELP, DUE IN MONDAY!!! broadcasting problem

when [shooter1] clicked
broadcast [first broadcast v]
end 
when [shooter2] clicked
broadcast [second broadcast v]
end 
I'm not sure I entirely understand your problem


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-07-08 12:20:43

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

Re: HELP, DUE IN MONDAY!!! broadcasting problem

My problem is that I need to get my sprites to communicate with each other, basically, I want them to do this:

For shooter(s):
"when shooter (insert number here) clicked"
"broadcast (something)"

Then wall(s):
"When I recieve (something)"
"if I have been clicked"
"broadcast (something2)

For coin(s):
"when  recieve (something2)"
"Glide to x:-240 y: -125"

This is what I want the sprites to do, I just dont know how to get them to do it because there will be 5 walls, 3 coins and 3 shooters and they all need their own coding, Please Help!!!

Offline

 

#4 2012-07-08 12:30:05

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: HELP, DUE IN MONDAY!!! broadcasting problem

You just wrote what you need there anyway?


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#5 2012-07-08 12:32:43

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

Re: HELP, DUE IN MONDAY!!! broadcasting problem

I haven't because as far as I know, there is no block that says "if I have been clicked" is there?
I am just looking for a replacement of this block (or if I'm wrong and its already there, please tell me!)

Offline

 

#6 2012-07-08 13:11:12

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: HELP, DUE IN MONDAY!!! broadcasting problem

DoowNimajneb wrote:

I haven't because as far as I know, there is no block that says "if I have been clicked" is there?
I am just looking for a replacement of this block (or if I'm wrong and its already there, please tell me!)

It already is there, it is one of the 4 hats found in Control.  smile

Last edited by SciTecCf (2012-07-08 13:11:49)


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#7 2012-07-08 13:14:13

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: HELP, DUE IN MONDAY!!! broadcasting problem

No,he means a boolean.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#8 2012-07-08 13:19:15

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

Re: HELP, DUE IN MONDAY!!! broadcasting problem

I can't use a hat because the 'if I have been clicked' block I mentioned is in the middle of a script and they don't fit I can't use them,    sad
Please can you see if you can find an alternative to it?

Offline

 

#9 2012-07-08 13:25:06

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: HELP, DUE IN MONDAY!!! broadcasting problem

when gf clicked
forever
 if <<mouse down?> and <touching [mouse-pointer v]?>>
 wait (0.04) secs
  if <<not <mouse down?>> and <touching [mouse-pointer v]?>>
  set [clicked v] to [1]
  wait (0.001) secs
  set [clicked v] to [0]
  end
 end
And this is the boolean you are gonna use:
<(clicked) = [1]>

Last edited by berberberber (2012-07-08 13:25:29)


http://i47.tinypic.com/2iaa73k.png

Offline

 

#10 2012-07-08 13:39:39

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

Re: HELP, DUE IN MONDAY!!! broadcasting problem

Thanks berberberber, I think this will work and I understand the script, But, I have one question...
Which sprite do I put the first script in that starts with:
"When 'Green Flag' clicked
forever
if (mouse down?) and (touching mouse-pointer)
etc.
Once again,
Thanks berberberber, I think this will work and I understand the script, But, I have one question...
Which sprite do I put the first script in that starts with:

Offline

 

#11 2012-07-08 13:40:37

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: HELP, DUE IN MONDAY!!! broadcasting problem

In the sprites you want to be clicked.


http://i47.tinypic.com/2iaa73k.png

Offline

 

Board footer