Using Codey Rocky & Sprite code blocks together


#1

Hi,

codeyrocky

In this example, I would like to:

Codey Rocky will tell me the weather of Marrakesh. If it is sunny, my sprite will turn a sun. If it is cloudly, it will turn a cloud.

But i couldn’t add the code blocks of sprite, because sprite doesn’t appear when the device is selected. I want to use codey rocky’s and sprite’s code blocks together.

I can use the code blocks together in mBlock V4.0.4 or below.

Is that about uploading code into Codey Rocky?

Any idea?


#2

Use Broadcast Block. Broadcasts travels between devices and sprites. You may also use global variables to share data with sprites.

In the upcoming version, there will be a Default (Scratch) mode, where devices execute commands instantly and interact with the stage (via broadcasts and global variables); and an Upload mode, similar to the mBot device in mBlock 5.

The reason of doing this is because there was always confusion about which block could be uploaded and which block could not. And using broadcasts and variables is a common way of doing Scratch. Also, separating code is standard in real world engineering practice.


#3

Thank you so much ! I did it like you said and it works ! :slight_smile:


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.