Git Product home page Git Product logo

minecraft's Introduction

pyCraftr

pyCraftr

Simple Minecraft-inspired demo written in Python and Pyglet.

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

How to Run

pip install pyglet
git clone [email protected]:boskee/Minecraft
cd Minecraft
python main.py

You may also need to install AVBin library (http://avbin.github.com/AVbin/Download.html), especially if you are on Linux machine. If you have Windows or Linux operating system, you will also need to install OpenAL library (http://connect.creativelabs.com/openal/default.aspx).

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:

arch -i386 python main.py

If that doesn't work, set Python to run in 32-bit mode by default:

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:

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

If you don't have pip or git

Windows Pyglet builds

See this website, and download the correct version for the OS.
This is important to get this, as how it will have AVBin included with it.

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyglet
    For a 32 bit Windows Os, get the file named "pyglet-1.2alpha1.win32-py2.7.‌exe"
    For a 64 bit Windows Os, get the file named "pyglet-1.2alpha1.win-amd64-py2.7.‌exe"

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.
  • Ubuntu: install with sudo apt-get install python-pip
  • Windows: install Distribute then Pip using the linked .MSI installers.

For git:

  • Mac: install Homebrew first, then brew install git.
  • Windows or Linux: see Installing Git from the Pro Git book.

See the 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 / (in flying mode) fly
  • Shift: (in flying mode) fly down
  • Tab: toggle flying mode

Building

  • 1 - 9: Selecting item in inventory
  • Mouse left-click: remove block
  • Mouse right-click: create block

GUI

  • B / F3: Toggle UI
  • E: Show inventory
  • V: Saving (save filename in command-line arguments)
  • ENTER: Move selected item to inventory / quick slots
  • Mouse left-click (in inventory): Pick up item and after second click put off last item
  • Mouse right-click when not focused on block: Eat item

Quitting

  • ESC / Q: release mouse, then close window

Better performance using Cython

For optimal performance, you can compile the code to C using Cython.

To do so, you have to install Cython and Python dev files (sudo apt-get install cython python-dev under Ubuntu), then run python setup.py build_ext --inplace. You will have to run this last command each time you update the game.

setup.py will also compile Pyglet using Cython, if you download the pyglet source code and put the pyglet folder inside the game repository.

minecraft's People

Contributors

boskee avatar ronmurphy avatar bertrandbordage avatar nebual avatar tfaris avatar fogleman avatar swiftcoder avatar embatbr avatar richvel avatar ggaughan avatar silent1mezzo avatar geppettodivacin avatar emportella avatar alexjmu avatar progval avatar ubershmekel avatar zg avatar blainmaguire avatar

Watchers

James Cloos avatar 黄昊靖 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.