# Minecraft
Simple Minecraft-inspired demo written in Python and Pyglet.
http://www.youtube.com/watch?v=kC3lwK631X8
**Like this project?**
You might also like my other Minecraft clone written in C using modern OpenGL (GL shader language). It performs better, has better terrain generation and saves state to a sqlite database. See here:
https://github.com/fogleman/Craft
## Goals and Vision
I would like to see this project turn into an educational tool. Kids love Minecraft and Python is a great first language.
This is a good opportunity to get children excited about programming.
The code should become well commented and more easily configurable. It should be easy to make some simple changes
and see the results quickly.
I think it would be great to turn the project into more of a library / API... a Python package that you import and then
use / configure to setup a world and run it. Something along these lines...
```python
import mc
world = mc.World(...)
world.set_block(x, y, z, mc.DIRT)
mc.run(world)
```
The API could contain functionality for the following:
- Easily configurable parameters like gravity, jump velocity, walking speed, etc.
- Hooks for terrain generation.
## How to Run
```shell
pip install pyglet
git clone https://github.com/fogleman/Minecraft.git
cd Minecraft
python main.py
```
### Mac
On Mac OS X, you may have an issue with running Pyglet in 64-bit mode. Try running Python in 32-bit mode first:
```shell
arch -i386 python main.py
```
If that doesn't work, set Python to run in 32-bit mode by default:
```shell
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
```
This assumes you are using the OS X default Python. Works on Lion 10.7 with the default Python 2.7, and may work on other versions too. Please raise an issue if not.
Or try Pyglet 1.2 alpha, which supports 64-bit mode:
```shell
pip install https://pyglet.googlecode.com/files/pyglet-1.2alpha1.tar.gz
```
### If you don't have pip or git
For pip:
- Mac or Linux: install with `sudo easy_install pip` (Mac or Linux) - or (Linux) find a package called something like 'python-pip' in your package manager.
- Windows: [install Distribute then Pip](http://stackoverflow.com/a/12476379/992887) using the linked .MSI installers.
For git:
- Mac: install [Homebrew](http://mxcl.github.com/homebrew/) first, then `brew install git`.
- Windows or Linux: see [Installing Git](http://git-scm.com/book/en/Getting-Started-Installing-Git) from the _Pro Git_ book.
See the [wiki](https://github.com/fogleman/Minecraft/wiki) for this project to install Python, and other tips.
## How to Play
### Moving
- W: forward
- S: back
- A: strafe left
- D: strafe right
- Mouse: look around
- Space: jump
- Tab: toggle flying mode
### Building
- Selecting type of block to create:
- 1: brick
- 2: grass
- 3: sand
- Mouse left-click: remove block
- Mouse right-click: create block
### Quitting
- ESC: release mouse, then close window
没有合适的资源?快使用搜索试试~ 我知道了~
Python游戏代码集
共13个文件
zip:7个
rar:2个
license:1个
0 下载量 158 浏览量
2024-04-18
19:16:37
上传
评论
收藏 51.08MB ZIP 举报
温馨提示
Python游戏代码集
资源推荐
资源详情
资源评论
收起资源包目录
新建压缩.zip (13个子文件)
游戏代码
天天酷跑源码.rar 10.27MB
植物大战僵尸.rar 45KB
消消乐.zip 1.78MB
大富翁.zip 16.25MB
单机版塔防游戏.zip 12.6MB
中国象棋.zip 290KB
21 我的世界
21 我的世界
main.py 29KB
LICENSE 1KB
texture.png 5KB
README.md 3KB
21 我的世界.zip 15KB
小鸟管道.zip 249KB
超级玛丽.zip 9.61MB
共 13 条
- 1
资源评论
安夏886
- 粉丝: 103
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功