推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
Hawstein
V2EX  ›  Python

Python写的Minecraft游戏

  •  
  •   Hawstein ·
    Hawstein · Apr 1, 2013 · 9367 views
    This topic created in 4973 days ago, the information mentioned may be changed or developed.
    Writing programs in Python is fun.
    Writing games is fun.
    Writing games in Python is fun!
    ——引自一篇Pyglet教程

    最近在看Pyglet,然后在github上看到有人用Python和Pyglet写了个简单的Minecraft游戏, fork过来, 一共只有几百行代码,麻雀虽小,五脏俱全,觉得挺有意思的, 于是把源码读了一遍,并做了详细的注释。 通过这个例子学习Pyglet和Python游戏编程还是不错的,推荐。

    地址:
    https://github.com/Hawstein/PyMinecraft
    18 replies  •  1970-01-01 08:00:00 +08:00
    wenLiangcan
    wenLiangcan
    Apr 1, 2013
    1
    有意思
    wissen
    wissen
    Apr 1, 2013
    2
    尽管使用了楼主提供的方法,但在 MacBook Pro 上还是无法运行。
    nichan
    nichan
    Apr 1, 2013
    3
    不知道用python写的话性能怎么样,被原版的java弄的欲仙欲死……
    Hawstein
    Hawstein
    OP
    Apr 1, 2013❤️1
    4
    @wissen 我用的是Linux,不知MacBook报的什么错?
    wenLiangcan
    wenLiangcan
    Apr 1, 2013
    5
    那个,请问是不是不支持Windows?( ̄_ ̄|||)
    Hawstein
    Hawstein
    OP
    Apr 1, 2013
    6
    @nichan 目前只是单机版,性能的话没做过测试。用python写游戏是OK的,一款web game在人数没有达到一定数量前,性能都不是主要问题,我觉得。
    ihao
    ihao
    Apr 1, 2013
    7
    @wissen
    不知道是不是报的Quicktime包的错误。查了下是因为默认运行了64位的python的原因。
    见:http://code.google.com/p/pyglet/issues/detail?id=438

    在air上跑了下,amazing。。
    ihao
    ihao
    Apr 1, 2013❤️1
    8
    export VERSIONER_PYTHON_PREFER_32_BIT=yes
    之后
    arch -i386 python main.py
    能在os10.8.2 python2.7.2 pyglet1.1.4下跑起来
    Hawstein
    Hawstein
    OP
    Apr 2, 2013
    9
    @wenLiangcan 你是不是用的64位的windows?在windows和mac下,pyglet还不支持64 python,所以你把python版本换成32位的应该就没问题的了。
    thedevil5032
    thedevil5032
    Apr 2, 2013 via iPad
    10
    爬出墙外居然可以跳下去...
    Hawstein
    Hawstein
    OP
    Apr 2, 2013
    11
    @thedevil5032 哈哈。。。还有很多地方要完善。XD
    wenLiangcan
    wenLiangcan
    Apr 2, 2013
    12
    @Hawstein 嗯,我的是64位,原来是这个原因啊。。。
    run2
    run2
    Apr 2, 2013❤️1
    13
    原repo里有这个提示

    Or, try Pyglet 1.2 which supports 64-bit mode.

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

    @wenLiangcan
    jsz
    jsz
    Apr 2, 2013
    14
    不错
    wenLiangcan
    wenLiangcan
    Apr 2, 2013
    15
    @sobigfish 谢谢,这个方法有效
    zhujinliang
    zhujinliang
    Apr 3, 2013
    16
    求有没有Javascript写的,或者有没有人想开发一个?使用浏览器,web3d,websocket,服务器端用nodejs。
    sunner
    sunner
    Apr 3, 2013
    17
    D:\Python27\lib\site-packages\pyglet\window\win32\__init__.py:552: UserWarning:
    unsupported extension.
    warnings.warn('Could not set vsync; unsupported extension.')
    Hawstein
    Hawstein
    OP
    Apr 3, 2013❤️1
    18
    @zhujinliang 已经有人做了:http://voxeljs.com/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2769 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 10:23 · PVG 18:23 · LAX 02:23 · JFK 05:23
    ♥ Do have faith in what you're doing.