Presentation is loading. Please wait.

Presentation is loading. Please wait.

Blockly Minecraft Task 1 ) Please copy the example task. Task by task

Similar presentations


Presentation on theme: "Blockly Minecraft Task 1 ) Please copy the example task. Task by task"— Presentation transcript:

1 Blockly Minecraft Task 1 ) Please copy the example task. Task by task
Blockly Minecraft Task 1 ) Please copy the example task. Task by task. Do not alter or personalise it in any way. Drag out the SKYMAP block Drag out a SKIN block Then select AGENTSMITH Press CTRL & D to bookmark and save your work Then press Run X

2 X Adding extra blocks Using the Minecraft blocks
Copy this block pattern Your blockly character needs a nickname – Call him Agent Smith X Now- Run the program Your character takes small steps – try changing the step to 1 – steps are longer – but not realistic Use right click to quickly create additional blocks so that walking looks more realistic. What will happen if you use move -0.5?

3 Using arrays Example A Example B A B Program B works slower why?
ReadS the randomly selected phrase from the list It then replaces the VARIABLE ARRAY list with the phrase (the full list is wiped from memory – replaced by the randomly selected text) The single phrase in memory is said (printed on screen) The next loop cycle all the phrases are re-read and the re-written back into the computer memory and stored as a new data for the variable array (LIST). This read write to memory process takes time causing a short delay. Program A only writes the information to Random Access Memory once it only looks up a random phrase which is already stored therefore the array is not changed in any way this is faster. Program A might need a delay or a steeping loop to slow it down so that it is more user friendly - readable. Program B is very efficient and fast. Program A works fine and is easy to read. There are often several ways to achieve the same outcome. Generally programs need to be very efficient and reponsive ie.fast. Program B works slower why?

4 Using variables – creating an array!
Drag in this VARIABLE block Give the variable a name Drag in this list block Drag in this minecraft block Duplicate it so that you have three copies. Add text phrases

5 Variables are usually defined at the start of a program
Drag and connect the quotes variable to the start of the program. A variable which stores several distinct pieces of data is called an ARRAY. This array is in the form of a list. X RAM CHIP If you press run – the array will not do anything. The data is simply stored in a memory location inside the computers RAM memory chip.

6 Lets create a path for Agent smith to walk
Drag a loop block from the control menu Your program should look like this! Set the loop to run 8 times Use 108 degrees Press CTRL & D to bookmark and save your work Then press Run Run the program to test it X

7 Make your character talk
Drag and connect these communication blocks from the Minecraft fly out option menu Type in Hello, World! This is a tradition that all programmers follow When you learn a new programming language Print(“Hello, World!) is usually your first step. Press CTRL & D to bookmark and save your work Then press Run X

8 Lets use the data array - Quotes
Drag and connect this communication block from the Minecraft fly out option menu Drag and connect this Lists block This command will pick RANDOM quotes from the data array and your character will say them on screen

9 Putting it all together
Agent Smith will now walk and talk randomly. E.g. b c a c b

10 Research Lets google search and find some cool phrases!

11 No delay block! No problem! Lets make one using a stepping loop

12 Going random Make Agent Smith unpredictable
Using random numbers in a loop creates interest. Make Agent Smith dance Using random walks -numbers walk backwards +numbers walk forwards

13 Task 2 Document your program. Like this. Use this example or the template provided. Task 3) Choose a different character. E.g. Mario Use the www to research his quotes. Test and document your program. Example


Download ppt "Blockly Minecraft Task 1 ) Please copy the example task. Task by task"

Similar presentations


Ads by Google