Skip to content

Reworked readme #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 47 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,60 @@
# Minecraft
# PyMinecraft by Hawstein

这是用Python和Pyglet写的简单的Minecraft游戏,
从<https://github.com/fogleman/Minecraft>fork过来的,
一共只有几百行代码,麻雀虽小,五脏俱全,觉得挺有意思的,
于是把源码读了一遍,并做了详细的注释。
通过这个例子学习Pyglet和Python游戏编程还是不错的,推荐。
This is a simple Python and Pyglet written Minecraft game. The orignal code that I used as a basis from my program is from Fogelman https://github.com/fogleman/Minecraftfork. I found the aforementied link served as a very good foundation, so I took certain parts of it and made edits.

以下是游戏视频:
## What to Expect
If you want to understand what Python/Pyglet Minecraft is, this youtube video will give you an idea as to what it is:

http://www.youtube.com/watch?v=kC3lwK631X8

## How to Run
## How to Run
First you must install pyglet using pip, this should be done in your terminal on your machine (ran by an adminstrator).
` pip install pyglet`
Next clone the respository.
` git clone https://github.com/Hawstein/PyMinecraft.git`
Change directories to PyMinecraft
` cd PyMinecraft`
Open up main.py using python
` python main.py`

##### Additional Details

pip install pyglet
git clone https://github.com/Hawstein/PyMinecraft.git
cd PyMinecraft
python main.py

在windows和mac下,pyglet还不支持64 python,对于64 mac,可以试一下:
In Windows and Mac, Pyglet does not support 64 python, so for 64-bit Mac, you try:

export VERSIONER_PYTHON_PREFER_32_BIT=yes
arch -i386 python main.py

或者使用支持64位的Pyglet 1.2:

You can also use Pyglet with 64-bit support 1.2:

pip install https://pyglet.googlecode.com/files/pyglet-1.2alpha1.tar.gz

## How to Play

### 移动

- W: 向前移动
- S: 向后移动
- A: 向左移动
- D: 向右移动
- Mouse: 改变视角
- Space: 跳
- Tab: 切換飞行模式(飞行模式是可以直接在垂直方向上运动的)

### 建造

- 选择要建造的方块类型
- 1: 砖块
- 2: 草地
- 3: 沙块
- 单击鼠标左键:移除方块
- 单击鼠标右键:添加方块

### 退出

- ESC: 释放鼠标,关闭窗口
## Editing main.py
It is recommended that you use Visual Studio Code to edit your main.py file, PyCharm or any other IDE. Make sure all pull requests to this repository state what is
being edited in details.

## How to Play
The game is played through keyboard and mouse. Below are the commands.

### Moving

- W: Move forward
- S: Move backward
- A: Move left
- D: Move right
- Mouse: Change perspective
- Space: Jump
- Tab: Switching flight mode (flight mode is directly in the vertical direction of movement)

### Building

- Select the type of material you want to build with (Selecting either 1,2, or 3 will change the block you are using to build)
- 1: Bricks
- 2: Grass
- 3: Sand
- Click the left mouse button: Remove the box
- Click the right mouse button: Add a square

### Exiting the Game

- ESC: Will close the game, and free your mouse