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

Post on 17-Dec-2015

221 views 2 download

Tags:

Transcript of Blockly Minecraft Blockly Minecraft Task 1 ) Please copy the example task. Task by task. Do not...

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

Do not alter or personalise it in any way.

Drag out the SKYMAP blockDrag out a SKIN block

Then select AGENTSMITH Press CTRL & D to bookmark and save your work

Then press Run

X

Adding extra blocks

Copy this block pattern

Your blockly character needs a nickname – Call him Agent Smith

Use right click to quickly create additional blocks so that walking looks more realistic.

Now- Run the program

Your character takes small steps – try changing the step to 1 – steps are longer – but not realistic

What will happen if you use move -0.5?

Using the Minecraft blocks

X

Using arrays

A

B

Program B works slower why?

Example B

Example A

Using variables – creating an array!Drag in this VARIABLE block

Give the variable a name

Drag in this minecraft block

Drag in this list block

Duplicate it so that you have three copies. Add text phrases

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.

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.

RAM CHIP

X

Lets create a path for Agent smith to walkDrag a loop block from the control menu

Set the loop to run 8 times

Use 108 degrees

Your program should look like this!

Run the program to test it

X

Press CTRL & D to bookmark and save your work

Then press Run

Make your character talkDrag and connect these communication blocks from the Minecraft fly out option menu

Type in Hello, World!This is a tradition that all programmers followWhen you learn a new programming language Print(“Hello, World!) is usually your first step.

X

Press CTRL & D to bookmark and save your work

Then press Run

Lets use the data array - QuotesDrag 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

Putting it all together

Agent Smith will now walk and talk randomly. E.g. b c a c b

• Research • Lets google search and find some cool

phrases!

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

Going random

Using random walks-numbers walk backwards+numbers walk forwards

Make Agent Smith unpredictable

Using random numbers in a loop creates interest.

Make Agent Smith dance