Glossary
Code Block
A code block is an instruction to the program. When a program runs, it goes through all of the code blocks you’ve set up and executes their instructions. A {"func":"blockMotionMove"}
code block instructs the program to move whatever Actor’s code that code block is in. A {"func":"blockLooksNextBackground"}
code block instructs the program to change the Background.
Parameter
Some code blocks have a blank white space called a parameter that you get to fill in. The code block will do different things when you pass in different parameters. For example, the {"func":"blockLooksSwitchCostume"}
takes a parameter that is the name of one of your Actor’s Costumes.
When Play Clicked
When play is clicked, your program starts to run. Any code without an event block above it will execute. Code under {"func":"registerSpriteTrigger"}
will also execute. Then, the program waits for any events to happen, like {"func":"registerSpriteTrigger"}
and executes those events’ code when they occur.
Event
An event is a type of code block that either waits for something to happen during a program or sends a message to another event block during a program. For example, {"func":"registerKeyTrigger"}
, {"func":"registerSpriteTrigger"}
, {"func":"registerFlagTrigger"}
, and {"func":"registerBroadcastTrigger"}
are all event blocks. These blocks activate all the code attached below them when their specific event occurs during the program.
Actor
An Actor is just any object that is part of your program other than the Stage. Each Actor has its own code, but you can send messages from one Actor to another with the {"func":"blockControlBroadcast"}
code block.
Conditional
A conditional is a code block like {"func":"blockControlIf"}
that contains some code below it, but the code below it is only activated if the parameter to the {"func":"blockControlIf"}
block is true. For example, a common conditional to use in an Actor’s code is the {"func":"blockMotionBounceOnEdge"}
code block with the ‘bounce’ code block attached below it.
Variable
A variable is a value that can change throughout the program. You can create variables, give them names, and update them throughout the program. For example, you might want to create a variable called ‘score’ that starts at 0 but increments by 1 each time one of your Actors collects a coin. Variables can be passed in as parameters to code blocks, too.
Finite Loop
A finite loop is a loop that, unlike an infinite loop, only repeats the code inside it a certain amount of time and then ends. You can create finite loops with the {"func":"blockControlRepeat"}
block, which takes a parameter that is the number of times you want the code inside it to repeat.
Function
A function is a set of code blocks. If you have a particular set of code blocks that you use more than once, you might want to make them into a function by giving this set of blocks a name. This way, when you want to use that set of blocks again, you just have to call the function name (1 block) instead of redoing the entire set of blocks.
Recursion
Recursion is when a function calls itself. Recursive functions usually contain a conditional at the beginning which exits the function on a certain condition, like if one of its parameters has a certain value. Otherwise, the function would keep calling itself over and over and never end.
Cloning
Cloning an Actor makes a copy of the specified Actor. Usually, you will call {"func":"blockControlCloneActor"}
, in which case the parameter is one of your Actors. In that Actor’s code, you should have a {"func":"registerCloned"}
block with code beneath it that specifies what the clone should do. Once the program hits your {"func":"blockControlCloneActor"}
block, it literally creates a new Actor for you.
Operator
An operator is a code block that can manipulate the value of its parameters. A lot of operators are ones you are familiar with from math, like {"func":"valueOpAdd"}
, {"func":"valueOpSubtract"}
, {"func":"valueOpMultiply"}
, or {"func":"valueOpDivide"}
. These operators will create a number. Some operators create a boolean value, which means true or false, and can be used as parameters to conditionals. For example {"func":"valueOpLess","values":[{"type":"number","value":"3"},{"type":"number","value":"5"}]}
will produce true. You don’t have to pass in constants like ‘3’ and ‘5’ to operator code blocks; you can pass in variables, too.
Tynkerblocks
Tynkerblocks are Actors that come with pre-made code for you to use. You can add them and interact with them just like normal Actors, but they already will have code that makes them do certain things.
Fractal
A fractal is a geometric object that shows the same shape no matter how much you ‘zoom in’ or ‘zoom out’ of it. Fractals have a recursive nature, because when drawing a fractal, you want to keep repeating the same shape (just at a different scale) over and over.
Bezier Curve
Bezier curves are curves that are defined by points and appear smooth. The curve will have a starting and and ending point, and other points push the curve to bend in a certain way.
Lists
We have lists in programming just like we have lists in real life. A list is just a specific type of variable that holds a bunch of other variables or constants. For example, you can have a list of numbers or words. There are code blocks to add, delete, insert, and replace items from lists under the variables section. You can also check if a certain list contains a specific item (another type of conditional!)
Strings
Strings are any combination of letters, like ‘b’, ‘cats’, ‘I like to play soccer’, or even the empty string ‘’.
Cloud Variable
Cloud variables are variables that are stored on the server and are ‘global.’ This means you can access a cloud variable’s value from anywhere in Tynker!
userID Code Block
This block returns a unique value for any Tynker user using your project. For example, you can use this in conjunction with cloud variables to create leaderboards for games that you publish.
- Getting Started
- Welcome to Tynker
- Minecraft Guide
- Tools
- Workshop
- Character Creator
- Level Editor
- Backpack
- Debugger
- Sharing
- LEGO WeDo
- Tips & Tricks
- Video Tutorials
- Working with Actors
- Music and Drawing
- Physics Engine
- Game Design
- Other Topics
- Tech Setup
- Glossary
- Blocks Reference
- Events
- Control
- Motion
- Animation
- Looks
- Sensing
- Sound
- Operator
- Pen
- Physics
- Variables
- Lists
- Functions
- Level Design
- Hardware
- Library Reference
- Platformer
- Top Down