Blockly coding samples

Do you have any other sample lessons for coding? The shark coding is a nice intro, but as a teacher not knowing how to code in Blockly, I need more examples of how to use the tool. I see many examples of how to create a really amazing 3D environment, but very little on how to use the code to “make it come alive”. My students have used Scratch and would like to be able to do similar things in CoSpaces, but I don’t know where to find lessons to teach them. Scratch has so many more resources for teachers. It would be nice to have a brief tutorial on how to use each block and then a sample lesson on how to put those ideas together in a lesson for students. OR even a lesson to show them how to make a “game”/activity like the pirate plunder or the robot rattle. You show how to “play” the skating game, but how do I instruct students how to make one themselves. I don’t know the Blockly code needed. HELP PLEASE!
Thanks!

1 Like

Hi everyone. I already share all my documents with the CoSpaces community (Facebook and forum).
Here are some tutorials I used this year with french beginners:



And here are some fun stuff for young students:





2 Likes

Thank you for sharing these! Is there a way to see the code that goes with them? I can only access them in play mode right now.

1 Like

You can join the class I used to share my work on Facebook with this code V4AEB from this link CoSpaces Edu: Make AR & VR in the classroom

2 Likes

Is there a “Cheat Sheet” that shows each of the blocks and what it is used for? Maybe with a breakdown by category? I am looking at a tutorial for switching cameras and it shows a “code” block. I have not been able to locate this block.

Also is this the only way to switch from one camera to another? It seems as if there should be a “switch camera to” block with a drop down of the cameras that are active objects in the program.

Thanks!

1 Like

Here is the suggested code:
44 AM

Here is what I am trying:
14 AM

1 Like

JoAnn_Rosebrock, Camera 1 is not a valid JavaScript variable name (in particular, JavaScript identifier names should not contain spaces) and it can not be used in “JavaScript” block.

And code on the first screenshot (“suggested” code) looks correct, doesn’t it work on your side?

I am unable to locate the “coding” block in the “suggested” code. The closest I was able to find was the “JavaScript” block. Where do I find the “coding” block?

1 Like

Removing the space worked! Thanks!

1 Like

Indeed, “Coding” block was renamed to “JavaScript” in one of the recent updates, so this screenshot is a bit out-of-date. But this is essentially the same block, it is only name that changed.

1 Like

Thanks you!! I appreciate your help!

1 Like

OK, here is another “challenge” my students have come across. (We are exploring “physics” in the inspector and in the Blockly code blocks.) How would we code an object (maybe a ball, rabbit, etc.) to bounce forward a certain number of times and then stop? Right now their objects are either bouncing in place or bouncing haphazardly all over the scene. :slight_smile:
Continually learning, Thanks!

1 Like

Hello JoAnn,
I too had many problems with the physics blocks but have now acustomed myself to their “weirdness”. I made a quick exmple to demonstrate how I spawned a stone to make it bounce in place and another where the stone is moved to the side. To look at the code join this class :XJ7KN.
And to look at the space refer to this link:
https://cospac.es/edu/AzP4
If you have any question feel free to ask :slight_smile:

2 Likes

I hope it’s ok but I joined the “class” too so I can see the code. Thank you for posting it!

1 Like

Hi JoAnn,
I am also new to blockly. I know some scratch. I’ve been going through the gallery of projects and copying some to my space and then looking at the code. It’s a great way to learn it.
Mary Beth

1 Like

Hi Mary,
Of course, after all the point is just to learn :slight_smile:

1 Like

Hi Luc,

When you share your space, click “allow others to remix”. This way people can see your code without having to join your class. Your class probably has a limited number of seats so your teacher might not like the join code shared out.

2 Likes

Thank you for the great sample lessons for coding! I am just a beginner!

1 Like