Skip to content

Repository files navigation

Codecube

CI License Media license ContentDB

Write lua code in Luanti and watch a drone build whatever you imagine

Codecube is a Luanti game built around one idea: everything you see was placed by a program. The programming itself is the CodeBlock mod, which the game bundles — a drone, an editor inside the game, a sandbox and a large API. What the game adds is somewhere worth building: a flat clean world with nothing to clear, bounded by a wall you can see through and a floor you cannot fall past, held at permanent noon, where nothing is breakable and the settings a drone wants are already set. Every panel and the hotbar are drawn in the game's own colours too, so the interface and the world read as one thing. It needs Luanti 5.9 or newer, because the floor and the wall are written on the engine's mapgen threads. The Lua and block reference is CodeBlock's, at doc/api.md.

License: code AGPL-3.0-only, media CC BY-SA 4.0 — see THIRD-PARTY-LICENSES.md
Credits: inspired by Gnancraft, ComputerCraft, Visual Bots, TurtleMiner, basic_robot

screenshot

Quick start

Run your first program

  1. Install the game from ContentDB and create a world — there is nothing to configure and no mod to enable
  2. Run the /codeblock tools command to be given the two drone tools
  3. Right click with drone_placer tool on a block to place the drone, choose stairs.lua then left click with drone_placer to start the drone

Write your first program

  1. Right click with drone_setter tool to open the lua editor
  2. Type a name in the New file: field and click + beside it, then write some code in the main window
  3. Click Load and close to load your code in the drone
  4. Right click with drone_placer tool on a block and run the code with a left click on drone_placer
  5. Read the Lua API to know which commands and blocks you can use

Explore and tweak

  • More built-in examples are available, just open the editor and choose an example to run
  • The world's size is one setting, mapgen_limit, under Content: Games → Codecube in the main menu. It bounds every axis, so raising it gives you a wider world and a higher ceiling; at the default of 4096 the wall stands at -4032 and 4047, a field 8080 nodes on a side rather than 8192, because only whole mapchunks inside the limit are generated
  • User codelevel can be adjusted to tweak drone performance and capacities, see permissions and chat commands

Releases

Contributors

Languages