Credits :CoSpaces Edu
this tutorial is the first of the coal blocks coding tutorial series watch it to learn the basics of coal blocks of visual programming language in Costa Mesa ztu

call blocks is a Block Base programming language that lets you add a major spaces with coal blocks you can easily code by simply dragging and dropping blocks of code of law presented snippet of code or statement that tells cospaces eating you to do something you can use coal blocks on the web with your computer or code on the fly with your tablet

find the code editor for coal blocks in the top-right toolbar off your space so they found the code I can and selectos blog the empty space on the right is the code locks work babe the list of locks on the left is the coal blocks to a box the program an object with coblocks we have to add it to collect first or double click on the object you would like to use activate news and coal blocks

kovaaks has two main types of locks expression and statement blogs safe and blocked often perform an action for example you let an item talk with the items they block or moving forward with the move items forward lock expression block contain values these values can be number text colors or other items in the scene expression blocks are recognized by their round shape these lost must be placed into other blocks of code

you can place expression blocks into the workspace to easily combine them keep in mind that expression blocks won’t do anything when placed on their own you can also use blocks with special behavior such as variables functions answers learn more about them in the next coblocks tutorials

let’s try a quick counting example to make a character cheer and joy and less than a minute first dragon drop a character from the library into your seeing double flake or right click on your character open the object inspector navigate to the code I connect and enable using Cove lock your object can I use with coal blocks to make a click Event open the events category and find the one item click-lock simply drag and drop it into the coal blocks workspace to make our character say something open the actions category and get us a block or character is now able to say something but it won’t share yet let’s change that with a play animation block

play dance like your character see how they’ll animate and say something well done you’ve created your first interactive scene with Co blocks watch our other tutorial to learn more about coding and cospaces EDU

Credits :CoSpaces Edu
it’s at Oreo is part of the coal block coding tutorial series watch it to learn how to use functions in Coal block the visual programming language in Costa mesa’s edu if you’re new to Coal blocks start with the intro tutorial coblocks the basics first are helpful to keep your code organized easy to use and compacts without functions we would need to repeat a lot of coating work and remember what happened where when and how functions are a collection of statement blocks that can be used like one statement block you can use or call function blocks with parameters which let you create a unique behavior for each call

let’s start with a simple function whenever we call the function return an item towards another item and measure the distance between the two let’s look at the blocks that we need for this function we need a turned item to look at items statements lock and items they statements lock a distance between item expression block and a round number expression block so that the distance is shown as an Easy-to-Read number looks simple enough now let’s play these locks into a function Block in the function category press to create function button and give your function and name

place all the blocks needed into the red function block that you’ve added to use your new fashion statement block drag it into the workspace and place a just below the Wind Lake 6:00 well done you’ve just created your first function but their faces right now it’s limited

how do you measure the distance to any other item in my scene with this block let’s see how to make this function more flexible with the help of parameters

parameters are like variables but they exist only inside a function blog you can give them values whenever you called or use a function Block in your workspace let’s use parameters to define a new item as measuring Target for our function tap or click on the function definition and select edit function add parameter parameter Target item you can also give the parameter a type types help you to prevent using the wrong values inside the function statement in our case we want to use another item as a parameter so we set a time to see nitom click update to change your function see how we have a new Target item parameter inside of our function definition simply dragged it into the look at and distance between item block you can now select which item you want to measure the distance to

you can also call functions inside of other functions this lets you organize your code and trade complex interactions while keeping an overview let’s add another function to create slick events for each create a new function called Creek Lake event for and add an item parameter to it

in this function we used when item click lock the Freaks Like events for the item in the event lock we call the measure function and give it the item parameter we then add create event function block for all items we want to measure in our scene

that’s it hit play to test what you programmed

watch our other tutorial to learn more about coding in Coast bases EDU

Credits :CoSpaces Edu
let’s learn about variables variables are the bread and butter of programs without them it’s hard to make sense of the Countess words and numbers we use to make things fly run speak fall and dents in this tutorial will show you how to use variables in Coal blocks and the magic you can’t read with them

to create a variable in Coal blocks open the data variables category Indico black toolbox then drag-and-drop the set variable locked into your workspace see the default variable name my boss you’ll be able to change it to one that suits your needs

now that you’ve defined your first variable that’s count some numbers in the values category you’ll find expression blocks to feed our variable with we sorta number in our variable to use that we place a statement flock such as the item saved lock in place or variable expression block inside

you can update the value of variable block holes by using the change variable by blog let’s have our item count how many times it was clicked to do this use the one item is Click lock and place the change of variables I’ve locked inside make it count up one with each click plank the items they lock inside so that our character will tell us the value of the variable at each click

let’s go to quick example with a locked door to unlock it and objects first first that’s a door and a key to our scene

open the window to find a variable can you collect it and set it to false

now we create create event for each object or item that starts with a key when the key is clicks we set the variable T collected to truth and remove the key

text now add the event for the door to check the status of the variable we need an F block from the control category when the door is clicked which act like he collected variable if it’s fault because we haven’t picked up the key yet the door will tell us that it is closed if it’s true because we picked up the key the door will open that’s it hit play to test what do you program

watch our other tutorial to learn more about Cody and KO faces EDU

Add a review

Origin Ten  Ltd,
Queens House
200 Lower High Street
Watford
WD17 2EH

Stay tuned

Exceptional quality. Ethical factories. Radical Transparency. Shipping and returns.

    Privacy Preference Center