Switch between CoBlocks and Javascript?

Is it possible to switch between CoBlocks and Javascript in the same space?

2 Likes

If you run separate tabs of code they can run in the same Space and Scene. I have several spaces that include Script and CoBlocks

1 Like

Hi Brian,

I have the same question. I think what she is asking is if you can start with CoBlocks and switch over to Script. So everything that was placed as CoBlocks is translated to Script. I understand that you are using both for a scene.

Is this. possible?

You could use Properties to have variables synchronised between Script and CoBlocks. All other interactions could be done from a code using loops and if conditions.

If you specify you question, I could help you with a detailed example.

3 Likes

Hi Nikolay,
thank you for the response. I am looking to start in CoBlocks and wanted to see if I can switch over to Javascripts. For example, if I have an object move using CoBlocks, can that same movement be brought into and translated into javascript?

Everything you could do in CoBlocks, could be done using Javascript. For moving, you could use one of the following methods: https://cospaces.io/api/classes/baseitem.html#transition.

One CoSpaces may have many CoBlocks and Script tabs. They will be executed as one long script one after another.

Hope that helps

1 Like

You are asking about being abe to have a project start in CoBlocks and then clicking a button the code would change into Script - like MakeCode for the micro:bit? No this isn’t possible. You have code for different objects or you can have Blocks and Script for one Object - but you can’t switch back and forth to see the Block Code and then the Script code.
Does that answer the question?

1 Like

Yes- thank you for clearing that up for me. :call_me_hand:t2:

1 Like