A Minecraft-inspired game for the terminal
Python C
Clone or download
Permalink
Failed to load latest commit information.
.gitignore ignore wiki directory Mar 2, 2017
LICENSE Update LICENSE Aug 5, 2015
README.md Use kbd notation Apr 4, 2017
colours.c Should be using fabs for floating point numbers Aug 15, 2016
colours.py Remove duplicate functions Feb 18, 2016
console.py Fix bug with sky colour in python renderer May 13, 2018
convert.py Neatened some things Oct 1, 2014
data.c Merge branch 'mobs' into python-renderer-update Feb 12, 2017
data.py Tune cave generation May 14, 2018
events.py Boom's cause damage Mar 2, 2017
items.py Player death drops last 5 mins Dec 19, 2016
main.py Calculate gravity on extended edges May 11, 2018
mobs.py fix mob attack calculation May 13, 2018
nbinput.py Add escape code support for non-blocking input, #92 Jan 28, 2016
network.py Improve network reliability for receiving, #39, #90 Jan 31, 2016
pathfinding.py Move mob pathfinding into separate file and refactor mob spawning May 13, 2018
player.py Add colour effects to render objects for changing player colour with … May 12, 2018
render.h Fix lights relative positioning in c lighting_buffer Mar 1, 2017
render.py Fix bug with sky colour in python renderer May 13, 2018
render_c_module.c Fix bug with sky colour in python renderer May 13, 2018
render_interface.py Fallback to day lightness value in get_light_level to allow mob spawn… Mar 2, 2017
saves.py Add error message when unable to create save dir Jun 20, 2018
server.py spawn mobs between 5 and 10 blocks from players, fixes #140 Mar 2, 2017
server_interface.py Boom's cause damage Mar 2, 2017
setup.py Add C build stage for translating data.py to data.c Aug 22, 2016
terrain.py Tune cave generation May 14, 2018
tester.py Fix pycraft tester May 11, 2018
translate_data.py Use lighting buffer to fill in background lights Jan 23, 2017
ui.py save settings in menu to file Feb 16, 2017

README.md

Pycraft (Termcraft)

A console based 2D Minecraft, runs best on *nix with Python 3.3+. Built by grit96 and olls.

Usage: python3 main.py

Pycraft gameplay image

Controls

For the best control, you should set your keyboard repeat time to around 200-300ms.

Menus:
   Move up                    - W or UP
   Move down                  - S or DOWN
   Select                     - SPACE or RETURN
   Pause                      - SPACE or RETURN
Blocks:
   Break/place block          - K
   Move cursor clockwise      - L
   Move cursor anti-clockwise - J
Inventory:
   Cycle inventory down       - O
   Cycle inventory up         - U
   Toggle crafting menu       - C
   Craft selected item        - I
Movement:
   Move left                  - A
   Move right                 - D
   Jump                       - W

Crafting

A number of items are only obtainable through crafting them using the crafting system. Items that you can craft with the items in your inventory will automatically show up in the crafting grid. Press C to toggle your selection between inventory and crafting grid, press I to craft the currently selected item.

Recipes:

  • 6 sticks:
    • 1 wood
  • 4 torches:
    • 1 stick
    • 1 coal
  • ladder:
    • 3 sticks
  • wooden pickaxe:
    • 2 sticks
    • 3 wood
  • stone pickaxe:
    • 2 sticks
    • 3 stone
  • iron pickaxe:
    • 2 sticks
    • 3 iron
  • diamond pickaxe:
    • 2 sticks
    • 3 diamonds

Tools:

Certain blocks require you to craft the right tool before being able to mine it. The tool has to be selected in your inventory to be able to use it. Each tier of pickaxe allows you to break more blocks than the previous tier.

  • fist (i.e. don't need a tool):
    • grass
    • tall grass
    • wood
    • leaves
    • torch
    • ladder
  • wooden pickaxe:
    • stone
  • stone pickaxe:
    • coal
    • iron
  • iron pickaxe:
    • redstone
    • gold
    • diamond
  • diamond pickaxe:
    • emerald

Using the C Renderer

The C renderer is likely to be faster than the Python renderer, but to use it you must compile it first. To do this run the command: python3 setup.py build in the root of the repository. Then run the game as normal, and go in to the settings to swich the renderer.

Please report any bugs in the C renderer, or differences between the Python renderer and the C renderer, in the issues.

Contributing

We welcome pull requests or issues for bug reports/fixes or new feature ideas! Help us make the game more fun :D