Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xgagandeep/pycraft

A small 2D version of Minecraft using python
https://github.com/xgagandeep/pycraft

Last synced: 6 days ago
JSON representation

A small 2D version of Minecraft using python

Awesome Lists containing this project

README

        

# PY-Craft 🎮

**Project:** PY-Craft
**Date:** March 2019
**Language:** Python
**Libraries:** Pygame
**Type:** 2D Sandbox Game

## Overview

PY-Craft is a simple 2D sandbox game inspired by Minecraft, created using Python and the Pygame library. In the game, players can explore a randomly generated world, place and pick up various objects, and craft new items using a set of predefined recipes.

## Features

- **World Generation:** The game creates a random world with various terrains including dirt, water, grass, sand, and wood.
- **Player Movement:** Move the player character around using the arrow keys.
- **Object Interaction:** Place or pick up objects in the world using numeric keys and the space bar.
- **Crafting System:** Craft new items from existing resources using specific recipes.
- **Inventory System:** Keep track of collected and crafted items in the player's inventory.
- **Instructions Display:** View crafting rules and inventory status on the screen.

## Controls

- **Arrow Keys:** Move the player character.
- **Number Keys (1-7):** Place corresponding object (grass, wood, water, glass, plank, brick, sand).
- **Space Bar:** Pick up an object from the world.
- **Key 'r':** Craft a brick using water and dirt.
- **Key 'u':** Craft a plank using wood.
- **Key 'i':** Craft glass using sand.

## Installation

1. Ensure you have Python and Pygame installed on your system.
2. Clone this repository:
```bash
git clone https://github.com/xgagandeep/py-craft.git
cd py-craft
```
3. Install Pygame if you haven't already:
```bash
pip install pygame
```
4. Download or ensure you have the following images in the same directory as `PYCraft.py`:
- `player.gif`
- `wood.gif`
- `water.gif`
- `plank.gif`
- `glass.gif`
- `brick.gif`
- `sand.gif`
- `dirt.gif`
- `grass.gif`

## Running the Game

To start the game, run:
```bash
python PYCraft.py
```

## Screenshots

*Include any relevant screenshots of the game here.*

## License

This project is open-source under the MIT License.