All Projects → Jflick58 → TeachPythonWithMinecraft

Jflick58 / TeachPythonWithMinecraft

Licence: MIT license
Teaching Python programming and concepts using the Python Minecraft API for the Raspberry Pi version of Minecraft.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to TeachPythonWithMinecraft

nrf24
nrf24l01 linux device driver
Stars: ✭ 20 (-57.45%)
Mutual labels:  rapsberrypi
digitalmusicstand
web based music sheet viewer (go, pdfjs) as a single binary
Stars: ✭ 22 (-53.19%)
Mutual labels:  rapsberrypi
Science Based Games List
Science-based games - a collaborative list
Stars: ✭ 1,461 (+3008.51%)
Mutual labels:  educational-game
SuperAdventure
Source code for my "Learn C# by building a simple RPG" guide
Stars: ✭ 38 (-19.15%)
Mutual labels:  educational-game
physics-is-beautiful
Files for Physics Is Beautiful Website
Stars: ✭ 12 (-74.47%)
Mutual labels:  educational-game
the-aviator
🎮 Welcome to the Aviator game!
Stars: ✭ 35 (-25.53%)
Mutual labels:  educational-game
rapid-router
A Blockly and python based educational game aimed at students age 5-14.
Stars: ✭ 50 (+6.38%)
Mutual labels:  educational-game
GeoGuess
GeoGuess is an open-source geography game with Google Map StreetView. You can play solo or with your friends simultaneously.
Stars: ✭ 174 (+270.21%)
Mutual labels:  educational-game
hackathons
💻💥 Open source directory of free student-led high school hackathons used by thousands of students worldwide
Stars: ✭ 116 (+146.81%)
Mutual labels:  high-school
ai-builders
A program for kids who want to build good AI
Stars: ✭ 19 (-59.57%)
Mutual labels:  high-school
Remote-Work-and-Study-Resources
Free services, tools, articles and other resources for remote workers and distance learners
Stars: ✭ 49 (+4.26%)
Mutual labels:  teaching-tools

TeachPythonWithMinecraft

Teaching Python programming and concepts using the Python Minecraft API for the Raspberry Pi version of Minecraft.

alt text

Background

This is the repo for the Florin High School (Sacramento, CA) Python workshop at KPMG. In this workshop, you'll learn Python programming and programming concepts by writing methods to control in-game Minecraft activites, and then you will connect those actions to a Flask-based website to act as a controller. We distributed Rapsberry Pi to the students for them to take with them after the workshop. If you don't have a rapsberry pi, you can emulate one on any Mac, Windows or Linux computer by following the instructions in this link.

You'll learn:

  • Basic version control with Github
  • Python Virtual Environments
  • Dependency Management
  • Variables
  • If Statements
  • Loops
  • Functions
  • Backend Web Development concepts

All this culminating in a Flask-based Web controller for Minecraft Pi!

Controller

How to use this repo

  1. Login to github with your account

  2. Click the "Star" button in the upper right hand corner.

  3. Click the "Fork" button

  4. Wait while Github copies the repo to your account

  5. Click the "Clone/Download" button and download the repo as a zip file to your machine

  6. Unzip the repo. Open a command prompt and CD to the location you extracted the repo to.

  7. Type virtualenv venv and hit enter.

  8. Wait while the virtual environment is activated. Then, type source venv/bin/activate and hit enter.

  9. You should see (venv) on the left side of your command prompt. Type pip3 install -r requirements.txt and hit enter

  10. You are ready to start learning Python with Minecraft! Bonus: You finished your first lesson on version control, virtual environments, and dependency management! Good Job!

  11. Follow the lessons in the Lessons Folder.

Useful Information

Create a script

Once the Pi has loaded and you are at the desktop screen, click on Menu then Programming and choose Python IDE3

Click file and select click script. To save, go to file then click save as.

We need to add an import for our script that will allow us to control Minecraft, type this code into the first line of your script

from mcpi.minecraft import Minecraft 

mc = Minecraft.create()

This import will need to be entered for every script you create

You can move to a new line in a script by pressing enter

A script can be run by pressing f5 or going to the run option on the top menu bar

Load Minecraft

Go to menu, go to games and click Minecraft. Bring this window alongside your Python script window so it is easier to use. You can move between the game and scripts by pressing the tab button.

In Minecraft click 'Create new world'. When this loads it will look something like the image below. Everyone’s will look different when it first loads. Start

Moving around the game

To move around the game, you can use the arrow keys and use the space button to jump.

Hints

Look out for Pete the pig. For some questions he'll give hints on how to do them.

pig

What if something goes wrong ?

If you get an error saying 'Syntax error' double check you have typed everything correctly and try running your script again.

Targeted Curriculum

Key Stage 2

• Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.

• Use sequence, selection, and repetition in programs; work with variables and various forms of input and output.

Key Stage 3

• Use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures, design and develop modular programs that use procedures or functions.

Useful Block ID's

Block ID Picture Block ID Picture
Air 0 Wood Planks 5 Woodplank
Stone 1 Stone Bedrock 7 Bedrock
Grass 2 Grass Sand 12 Sand
Dirt 3 Dirt Gravel 13 Gravel
Cobblestone 4 Cobble Glass 20 Glass
Leaves 18 Leaves Lava 11 Lava
Water 9 Water

Credits

  • Github user jeremycook94 for creating most of the lesson plans.
  • EV Computing for the readme image.
  • The Raspberry Pi Foundation for their work on Rapsberry Pi, and the Raspbian image that contains the Python and Minecraft distributions used in this workshop.
  • KPMG cowowrkers Matt Kwong, Andrew Suarez-Lopez, and Frank Wright
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].