![]() Je kun het eerste item in de lijst plaatsen, kopieer + plak de blokken en selecteer steeds het volgende nummer uit het dropdown-menu.Je hebt meer dan 3 plekken nodig. Ga naar “Lists” en zoek “create list with…” Voeg het “set … to” block toe in je scene. Nu verschijnen een aantal blokken in je ‘Variables’ sectie. Open “Variables”, en maak een ‘Variable’ met de naam “woodBlocks”. Open het coding scherm en selecteer ‘Blockly’. We gaan een lijst maken zodat we straks een actie gemakkelijker kunnen herhalen voor alle blokken. Vergeet niet op ‘enter’ te drukken na elke naamswijziging. Geef alle blokken een eigen naar(label) met en nummer. Open de ‘Hierarchy’ links in het ‘Scenes’ tabblad: Om deze blokken te kunnen programmeren moeten ze allemaal een eigen naam (label) hebben. Zorg dat ‘snapping’ (s) aan staat zodat alles recht komt te staan. Kopieer dit blok en stapel de blokken op als een Jenga toren, in totaal 12 blokken (4 rijen, 3 in elke rij). Geef het label de naam “woodBlock1”, en voeg toe aan Blockly: Verander het formaat van het blok met snapping aan (met “s”), zodat het 2 vierkanten breed, 2 vierkanten hoog en 6 vierkanten lang is. Zet de camera op ‘orbit’ en zet hem aan de zijkant. Hallo! Met deze tutorial maak je Jenga in Cospaces, met Blockly. I liked this one very much and translated it to Dutch for my students. ![]() ![]() If you want to experiment a little more, you can change the velocity to a different number, change the colours, or make the tower taller for a more spectacular fall! The code should all look like this:ģ3_Screen Shot at 13.21.28.png803x476 41.3 KB You can just delete this spare coordinates block.ģ2_Screen Shot at 13.18.36.png800x90 11 KBĬhange the velocity to 2. Then drag it to replace the xyz values you see in the blue block. Under Values you can find a block for this: We want every block to be pushed towards the camera, so for that we need the position of the camera. Place in your code like this and place the Variable “Item” in the first space.ģ0_Screen Shot at 13.18.05.png826x155 16.5 KB In Physics -> Simple you will find this block:Ģ9_Screen Shot at 13.10.32.png813圆7 9.67 KB To create this action we need to use a Physics block. We want the block to move a little towards the camera, like you’re nudging it with your hand. This means when you click (activate) any one of the wooden blocks in the scene, something will happen. Place it inside the first green block and make sure it says “Item”. Look in Events for this activation block: Then find “woodBlocks” in your Variables and add it to the end of the green block. In Control flow -> Loops find this block:Īdd it to the bottom of the code. Now we need to define what all the items in the list will do. You should end up with 12 blocks in the list. You’ll need more than three slots in this block, so add more with the little cog button and drag the symbol across to make new slots: You can place the first item into the list, copy + paste the block and select the next number from the drop down menu to get the next one. Go to “Lists” and find “create list with…” Now some blocks will appear in the Variables section. Open “Variables”, and create a Variable called “woodBlocks”. Open the coding window and select Blockly. We’re going to make a list, so an action can be repeated across all 12 items more easily. ![]() Don’t forget to press enter every time you finish editing the names!ġ5_Screen Shot at 11.40.59.png864圆85 142 KB Label all the wooden blocks according to number (there should be 12). Here you can see all your objects in the scene. Open the Hierarchy from the Scenes tab on the left: To use these blocks for coding, they need to be labelled differently. ![]() Keep snapping (s) on to keep everything nicely aligned. Label “woodBlock1”, and add it to Blockly:Ĭopy and stack the blocks like a Jenga tower, until you have 12 blocks (4 rows, 3 in each row). With snapping on (toggle with “s”), resize the block so it’s 2 squares wide, 2 squares high and 6 squares long. Set camera to orbit and move to the side. Hi everyone! Here’s a tutorial for making a Jenga tower that can fall down in Cospaces, just using Blockly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |