
How to connect your computer to your SPIKE Prime hub?
After you download the SPIKE programming software, to load a program to your robot, you need to connect to your hub! Now lets learn how you can do that!
- #1605
- 21 Jul 2020
After you download the SPIKE programming software, to load a program to your robot, you need to connect to your hub! Now lets learn how you can do that!
LEGO Levitating contraption appears to just... FLOAT IN THE AIR!?!? We can confirm, it really works! But how?
If we were to have a start block for every condition under which you might want your program to start, then they would be too many for us to learn all of them. Which is why we have a tool that executes code only if the condition we present is met.
If this is the first time you are using an "if" check block, watch the following video.
Some conditions are easier to describe in Scratch than others. We can check with a single block if a sprite is touching a color or if it is touching the mouse.
For more complex conditions, such as whether it is NOT touching a color or whether it is NOT touching the mouse, we need more blocks.
Not every program is a list of immediately executed commands. Sometimes we need to give the users of our programs some time or have the program wait for something else to be executed first.
We can achieve this with the wait block.
If we wish to check if two sprites touch eachother or a specific sprite is touching something on the screen, the easiest thing to do would be to check the color! Now you will findout how to do this.
Example solution to the task "Now add if the clone has touched a dirty clone to change his costume to dirty!":
When we wish for a sprite to appear or disappear on the screen, there are two ways in which we can achieve this. One of them would be to create the sprite when we wish to see it and destroy it when we want it to disappear.
Another way to achieve this goal is to make the sprite invisible when you wish for it to disappear and make it visible again when you need it again.
Example solution to the task "Program your character to be visible before he starts making copies.":
When you use the "create clone of" block to clone a certain sprite, its program is also cloned. The problem is that if this sprite starts when you hit the start button and the clones appear afterward, the clones wouldn't start their programs.
Which is why there is another starting block you can place in the program for when a clone appears.
Sometimes we wish to program something such as a day-night cycle, but we don't know how long the program should run, so we program it to run indefinitely.
That's how day and night cycle between each other until another command tells them to stop or the program is switched off.
Here's how to do this:
When we work with any sort of program, we need to save our files regularly to our computers. Afterwards, if we want to work on an old file, we need to load it from the computer.
Now we will learn how to do that in Scratch.
We can always manually change the costume in Scratch, but sometimes we might want to change it while the program is running.
Example solution to the task "Program your character to put on his clean costume before cloning 10 times and after cloning to put on his dirty costume." :
When 2D characters in video games are animater or change their shape, they actually change "their costumes" for each pose.
As you may have concluded, the costumes are essentially the different shapes that comprise the animated sprite. Now you will find out how to create costumes for your sprites.
In this course, you will learn how to program the game "Keep 'em clean". This is a game where the player controls a number of "people" on the screen using movements detected by a camera.
Example solution to the task "Using the repeat block, program your character to be cloned and moved to a random position 10 times."