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...
== Step-by-Step Instructions ==
=== 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. thumb|right|Step 6. Cube programmed to constantly turn red.|link=Special:FilePath/How_to_Use_Action_Blocks_and_Actions_BASIC_3.PNG
#Build a new world. 
#Drag a cube from the Build Panel onto the ground.
#With the cube selected drag the Action Panel out so that it is fully visible.
#*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.
#Notice that the the Action Panel has a green tile labeled Does with an arrow pointing to the right. 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.|link=Special:FilePath/How_to_Use_Action_Blocks_and_Actions_BASIC_5.PNG
#*When you drag an action to the left of Does it becomes a Condition.
#*When you drag an action to the right of Does it becomes a Command.
#*The Action Panel will constantly check for conditions and trigger commands.
#Open the Colors tab of the Build Panel.
#Drag the color Red to the right side of Does on the first row.
#Start Play Mode by pressing the play button in the upper left corner.
#*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.
#Return to Build Mode by pressing the build button in the upper left corner (crossed wrench and screwdriver). thumb|right|Step 16. Cube programmed to constantly turn red and turn blue while the L Button is pressed.|link=Special:FilePath/How_to_Use_Action_Blocks_and_Actions_BASIC_7.PNG
#Select the cube and if necessary drag the Action Panel out so that it is fully visible again.
#Open the Colors tab of the Build Panel.
#Drag the color Blue to the right side of Does on the second row.
#*Notice that both commands are set to trigger with the same condition.
#Start Play Mode.
#*Notice that because both commands trigger simultaneously the last command will take precedent and the cube will appear to turn and stay blue. 
#Return to Build Mode.
#Open the Actions tab of the Build Panel.
#Select the cube and if necessary drag the Action Panel out so that it is fully visible again.
#With the cube still selected, drag the L Button action to the left side of Does on the second row.
#*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.
#Start Play Mode.
#Press the L Button.
#*Notice that the cube only turns blue after pressing the L Button!
#*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.
== Step-by-Step Gallery ==
File:How to Use Action Blocks and Actions BASIC 2.PNG|Cube and Action Panel ready
File:How to Use Action Blocks and Actions BASIC 3.PNG|Cube programmed to constantly turn red
File:How to Use Action Blocks and Actions BASIC 4.PNG|Cube turns red in Play Mode
File:How to Use Action Blocks and Actions BASIC 5.PNG|Cube programmed to turn Red and then Blue
File:How to Use Action Blocks and Actions BASIC 6.PNG|Cube turned red then blue in Play Mode
File:How to Use Action Blocks and Actions BASIC 7.PNG|Cube programmed to turn red constantly and turn blue when pressing the L Button
File:How to Use Action Blocks and Actions BASIC 8.PNG|Cube turned red automatically
File:How to Use Action Blocks and Actions BASIC 9.PNG|Cube turns blue while pressing the L Button
Category:Learning