How To Use Action Blocks and Actions

Overview

 * Before beginning this How To it is recommended that you learn How To Build and Publish a World.


 * All blocks are programmable with Actions. Action Blocks have unique actions and specific functions which are unavailable to other blocks.
 * For example, Motors can make things spin, Rockets can provide thrust and the Magnet can attract other blocks.
 * In this How To you will learn the basics of using Action Blocks and Actions to control your contraptions. We wont cover any specific Action Block in-depth, but we will learn the general concepts behind all Action Blocks and Actions.
 * We will start with a very simple example and then expand to more complicated examples. At the end of this How To you should have a good understanding of the basic programming potential in Blocksworld!
 * Let's get started...

Basic Example

 * In this basic example we will learn how to use the Action Panel to change the color of a block both automatically and by pressing a button. [[Image:How to Use Action Blocks and Actions BASIC 3.PNG|thumb|right|Step 6. Cube programmed to constantly turn red.]]


 * 1) Build a new world.
 * 2) Drag a cube from the Build Panel onto the ground.
 * 3) With the cube selected drag the Action Panel out so that it is fully visible.
 * 4) *The Action Panel is a small grey tab on the left-most side of the screen. However, it is only visible when a block is selected.
 * 5) Notice that the the Action Panel has a green tile labeled Does with an arrow pointing to the right. [[Image:How to Use Action Blocks and Actions BASIC 5.PNG|thumb|right|Step 13. Cube programmed to turn red and blue. Both commands are being triggered at the same time so ultimately the cube will turn and apparently stay blue because that is the last command.]]
 * 6) *When you drag an action to the left of Does it becomes a Condition.
 * 7) *When you drag an action to the right of Does it becomes a Command.
 * 8) *The Action Panel will constantly check for conditions and trigger commands.
 * 9) Open the Colors tab of the Build Panel.
 * 10) Drag the color Red to the right side of Does on the first row.
 * 11) Start Play Mode by pressing the play button in the upper left corner.
 * 12) *Notice that as soon as you enter Play Mode the cube turns red! This is because we programmed the cube with the command to turn Red.
 * 13) Return to Build Mode by pressing the build button in the upper left corner (crossed wrench and screwdriver). [[Image:How to Use Action Blocks and Actions BASIC 7.PNG|thumb|right|Step 16. Cube programmed to constantly turn red and turn blue while the L Button is pressed.]]
 * 14) Select the cube and if necessary drag the Action Panel out so that it is fully visible again.
 * 15) Open the Colors tab of the Build Panel.
 * 16) Drag the color Blue to the right side of Does on the second row.
 * 17) *Notice that both commands are set to trigger with the same condition.
 * 18) Start Play Mode.
 * 19) *Notice that because both commands trigger simultaneously the last command will take precedent and the cube will appear to turn and stay blue.
 * 20) Return to Build Mode.
 * 21) Open the Actions tab of the Build Panel.
 * 22) Select the cube and if necessary drag the Action Panel out so that it is fully visible again.
 * 23) With the cube still selected, drag the L Button action to the left side of Does on the second row.
 * 24) *The L Button action is now a condition. In other words; the command to the right side of does will trigger while the L Button is pressed.
 * 25) Start Play Mode.
 * 26) Press the L Button.
 * 27) *Notice that the cube only turns blue after pressing the L Button!
 * 28) *Also notice that the cube will return to red as soon as you release the L Button!
 * The color red in this example is interchangeable with lots of other actions! For example, you could set the cube to Explode after pressing the L Button, or the cube could present a written message with Speak.
 * Continue with the Intermediate Example below to learn more!

Tips and Tricks

 * It can often be helpful to find and purchase an unlocked model in the Model Shop and to try and reverse engineer how it was built and programmed.
 * Don't be afraid to try all sorts of combinations to see what happens! Often some of the coolest contraptions are created by experimenting with action block functionality.