Skip to content

tarantino07/minecraft.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Minecraft implementation with ASCII characters in C

A simple 3D raycasting demo inspired by Minecraft, rendered in the terminal using ASCII characters and color codes.

Gameplay Screenshot

Prerequisites

You need a C compiler (like GCC) and the make utility installed.

  • macOS:
    • Install Xcode Command Line Tools: xcode-select --install
  • Windows:
    • Install MSYS2.
    • From the MSYS2 terminal, install the necessary tools: pacman -S mingw-w64-x86_64-gcc make
  • Linux:
    • Use your distribution's package manager, e.g., sudo apt update && sudo apt install build-essential (Debian/Ubuntu) or sudo dnf groupinstall "Development Tools" (Fedora).

Compilation

  1. Clone the repository (if you haven't already).
  2. Navigate to the project directory in your terminal (or MSYS2 terminal on Windows).
  3. Run the make command:
    make
    This will compile the minecraft.c source file and create an executable file named minecraft (or minecraft.exe on Windows).

Running

After successful compilation, run the executable from your terminal:

  • macOS / Linux:
    ./minecraft
  • Windows (MSYS2 terminal):
    ./minecraft.exe

Make sure your terminal window is large enough to display the output correctly (recommended ~180 rows, ~900 columns, although you can experiment).

Controls

  • w / s: Look up / down
  • a / d: Look left / right
  • i / k: Move forward / backward
  • j / l: Strafe left / right
  • x: Break the block you are looking at (highlighted green 'o')
  • space: Place a block ('@') on the face of the block you are looking at
  • q: Quit the game

Cleaning Up

To remove the compiled object file and executable, run:

make clean

About

the most basic minecraft in terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published