GithubHelp home page GithubHelp logo

dariobottazzi / minecraft Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fogleman/minecraft

0.0 2.0 0.0 17.55 MB

Simple Minecraft-inspired program using Python and Pyglet

License: MIT License

Python 100.00%

minecraft's Introduction

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...

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

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:

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

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 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
  • 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

minecraft's People

Watchers

 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.