Scratch 3 block help (Part 1)

I don't understand what you want.

Yes this predicate reports false when no message was received, and true when "any message" was broadcasted.

The issue is that the MESSAGE reporter reports the most recent broadcast message. If two different messages happen in quick succession you might miss one of them. That's why, if you're really serious about not losing a message, you have to keep a list of them.

The special menu of message consists of any message and other messages.
But when I use any message option
It reports false but it should report true.

the question to me is, what to you hope to achieve with the "message received" block. If you want to use that - as I suspect - to escape from a loop, think again.

Sorry I can't understand this.

what are you trying to accomplish? Is it something like this?

Untitled%20script%20pic%20(9)

Yes! It is like that.

Hi @sairam1235 ,

Different options... maybe the clearer one is using a variable. We don't need to store all the messages (like a messages log). Then, the message is the event, an the variable is the state.
gameOver

Of course, you don't need here a message, because "when space key pressed" can fire the variable change, and that is the event... but in this example, the change of "gave over" variable is fired by "game over" message. And then, we can "broadcast this message" in different parts of the project.

Joan

But can you make it as a single block

??

Your requested block <"text message" received?> is just the variable (text message).

If you want you can build your own predicate custom block where <"text message" ?> =(text message). This only to have it in a "predicate" form and in other category.

Beyond this only block, you must change the variable somewhere... but it is the same that in your original idea, where you should "broadcast" that message.

Joan

But I made

like this
But this one doesn't work properly
See down!
This makes the problem.

Oh. Wait. Are you literally putting the text "any thing" in your program? If so, you are dramatically overestimating how smart computers are. The language treats your messages as just meaningless text strings. The "any message" menu item in WHEN I RECEIVE doesn't look for an ANY MESSAGE message! It just starts your script when any BROADCAST is done. (Note that the BROADCAST block doesn't have "any message" in its menu.)

Also, trying to read your mind, I think you think that the MESSAGE block doesn't report a value unless a BROADCAST just happened. But actually it keeps its value until another BROADCAST changes it. So even if you got past the ANY MESSAGE problem, your block would only work the first time, before any BROADCAST happens. After that, it should always report True, because MESSAGE always has some value or other.

Yeah! That's my idea.

Edit:- I had my exams in school so that's why I am late.

Yes! But when I receive any message block will work when any broadcast is done.

And also the any message received? Block should also work like above and report true but it reports false.
That's my problem.

Could you send your code?

Yeah okay! I am sending my code.

No, I mean, do "Export project" and send the .xml file it creates. You can email it to me bh@cs.berkeley.edu.

Okay

I have some exams. So busy! Thanks for help! I will start doing this blocks after 13 th