c2i-junia / minecraft-rust

minecraft game clone built in rust.
Other
6 stars 2 forks source link
bevy bevy-engine game minecraft-clone rust-lang

minecraft-rust

Minecraft game clone written in Rust, using the Bevy game engine.

game preview : Aperçu du projet


Table of contents


Controls

Movement

Action Key
Jump Space
Strafe Left A / Arrow Left
Strafe Right D / Arrow Right
Walk Backward S / Arrow Down
Walk Forward W / Arrow Up
Toggle Fly Mode F
Fly Up Space
Fly Down Left Shift

Gameplay

Action Key
Destroy Block Left Mouse Button
Place Block Right Mouse Button

Inventory

Action Key/Mouse
Open/Close Inventory E
Pick up stack Left Click
Pick up half of stack Right Click (with empty mouse)
Deposit 1 item Right Click (over valid stack)
Deposit MAX items Left Click (over valid stack)
Exchange stacks Left Click (over a different stack or full valid stack)

A "valid stack" refers to a stack in the inventory that is either empty or contains the same items as the mouse cursor.

Miscellaneous

Action Key
Toggle FPS Display F3
Toggle Perspective F5
Toggle Chunk Debug F4
Toggle Block Debug F6
Decrease Render Distance O
Increase Render Distance P
Exit Game Escape


Building from source

Prerequisites

To build and run this project, you need the following tools and dependencies installed:

1. Rust

2. Just

3. Dependencies

Install the required dependencies based on your operating system:

Arch Linux
sudo pacman -S base-devel mold clang vulkan-radeon vulkan-tools
Ubuntu/Debian
sudo apt update && sudo apt install -y \
    build-essential mold clang mesa-vulkan-drivers vulkan-tools
Windows

Running the Project

To compile and run the game locally, use the following commands:

Note: the first compilation will be slow depending on your hardware, next compilations will be incremental and thus faster.

# Clone the repository
git clone https://github.com/c2i-junia/minecraft-rust

# Navigate to the project directory
cd minecraft-rust

Debug mode:

./run-server.sh  # this will compile the project and run the server
./run1.sh        # this will compile the project and run the client 

Release mode:

# Build the project in debug or release mode
./build.py release

# Run the executable
./minecraft-rust-client-1/bin/minecraft-rust


Contributing

Feel free to submit issues or open pull requests. If you want to know where to help, refer to the existing issues.

Guidelines

Format

Run cargo fmt before committing.

Commit messages:

We follow the Conventional Commit specification.

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Our commit types are inspired by the Karma specification

Allowed values:

Write commit messages in the present tense (e.g., "Add feature X" instead of "Added feature X").

If a commit is co-authored by multiple people, do not hesitate to add a Co-authored-by field. See GitHub documentation. For example:

$ git commit -m "Refactor usability tests.
>
>
Co-authored-by: NAME <NAME@EXAMPLE.COM>
Co-authored-by: ANOTHER-NAME <ANOTHER-NAME@EXAMPLE.COM>"

Branches