在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Jflick58/TeachPythonWithMinecraft开源软件地址(OpenSource Url):https://github.com/Jflick58/TeachPythonWithMinecraft开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):TeachPythonWithMinecraftTeaching Python programming and concepts using the Python Minecraft API for the Raspberry Pi version of Minecraft. BackgroundThis 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:
All this culminating in a Flask-based Web controller for Minecraft Pi! How to use this repo
Useful InformationCreate a scriptOnce 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 MinecraftGo 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. Moving around the gameTo move around the game, you can use the arrow keys and use the space button to jump. HintsLook out for Pete the pig. For some questions he'll give hints on how to do them. 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 CurriculumKey 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
Credits
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论