introduction to minecraft pi aims: to know what minecraft is to learn how to enter code into...

23
Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs into Minecraft Pi

Upload: homer-gilmore

Post on 18-Jan-2018

228 views

Category:

Documents


0 download

DESCRIPTION

 Minecraft is deliberately ‘blocky’ like LEGO, because it is easy to build when your bricks are the same shape!  The blocks are deliberately NOT highly detailed as this means the graphics can be drawn/updated quickly as you move around.  The Pi edition is special because it is not ‘locked down’ so you can code straight into it and make ‘Magic happen.’ “It looks rubbish!”

TRANSCRIPT

Page 1: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Introduction to Minecraft PiAims:

To know what Minecraft isTo learn how to enter code into Minecraft Pi

To successfully enter at least 2 Python programs into Minecraft Pi

Page 2: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

What is Minecraft Pi?

Minecraft is a program which lets you build virtual worlds, block-by-block, in a range of different materials.

You get a basic world given to you, it is then up to you what goes into it.

Minecraft Pi is an early development version of Minecraft Pocket Edition for phones & tablets.

Page 3: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Minecraft is deliberately ‘blocky’ like LEGO, because it is easy to build when your bricks are the same shape!

The blocks are deliberately NOT highly detailed as this means the graphics can be drawn/updated quickly as you move around.

The Pi edition is special because it is not ‘locked down’ so you can code straight into it and make ‘Magic happen.’

“It looks rubbish!”

Page 4: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Intro Video – What can you do with Minecraft Pi?

Source: youtube.com/watch?v=daT_R5ckIkU

Page 5: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

You will need to arrange 2 program windows on your desktop Minecraft Pi Python 2

Python is a programming language you will use to interact with Minecraft (make buildings, show messages, etc.)

Load BOTH programs and arrange your screen like this…

Get Set…

Page 6: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

In Python, you have the window to store the program code AND a window where it runs. You need to type your code into this window

Get the right Python

Page 7: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Minecraft & Python Screens

To enter your code, you click

FILE and NEW… To move the mouse out of

Minecraft, press the TAB key first

Page 8: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Have a quick look

around your

world, before we

move on

Moving around in Minecraft

Key ActionSpace Jump

Double-Tap Space

Fly or Land

Shift DuckE Inventory

Esc Back to Menu

LEF T

RIGHT

UP

DOWN

SPIN CAMERA

PLAC

E BL

OCK

DEST

ROY

BLOC

K

Page 9: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Start a new Python window, by clicking ‘File’ and ‘New.’

Click in your new empty Python window and type this code.

import mcpi.minecraft as minecraftmc = minecraft.Minecraft.create()msg = “Hello world”mc.postToChat(msg)

Click on File and save your code in yourPi ‘Documents’ folder as text.py

Try another few. What happens withlong sentences?

Text Messages

Capital letters and spaces MUST

be correct, or your code won’t

work

Page 10: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Graphs use X co-ordinates for left-right and Y co-ordinates for up-down.

Minecraft is a 3D game, so also has forwards-backwards movement.

X = Left-RightY = Up-DownZ = Forward-Backward

Where am I?

Page 11: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

There I am!( -3, 33, 97 )

Page 12: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

Start a new Python window by clicking ‘File’ and ‘New’. Click in this new window and type this code.

import mcpi.minecraft as minecraftimport time

mc = minecraft.Minecraft.create()

time.sleep(1)pos = mc.player.getPos()mc.postToChat(“You are located x=“ +str(pos.x) + “, y=“ +str(pos.y) +”, z=“ +str(pos.z))

time.sleep(2)mc.postToChat(“Get ready to fall from the sky!”)

time.sleep(5)mc.player.setPos(pos.x, pos.y + 60, pos.z)

Click on File and save your code in your Pi ‘Documents’ folder as teleport.py

TeleportingIf you can’t read the code, ask for

a worksheet

Page 13: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

You can now choose your next challenges. These are:

Challenge Sheets

EASY HARD EXTREME

Teleporting Instant Buildings Treasure Hunt

Flower Stalk Building Bridges Whack-a-mole!

Melon Teleporter

These do get difficult, so do try both Easy and at least 2 Hard sheets before doing the Extreme level

Page 14: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 15: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 16: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 17: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 18: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 19: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 20: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs
Page 21: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

With a Raspberry Pi camera you can even Minecraft your face!

Guess Who?Mr Foster

Page 23: Introduction to Minecraft Pi Aims: To know what Minecraft is To learn how to enter code into Minecraft Pi To successfully enter at least 2 Python programs

The End