GithubHelp home page GithubHelp logo

svercl / bracket-lib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amethyst/bracket-lib

0.0 0.0 0.0 11.58 MB

The Roguelike Toolkit (RLTK), implemented for Rust.

License: MIT License

Rust 99.84% HTML 0.03% Batchfile 0.13%

bracket-lib's Introduction

Welcome to bracket-lib

You can read a tutorial series on writing a Roguelike with this library at: https://bfnightly.bracketproductions.com/rustbook/

Bracket-lib is the primary support library for my book, Hands-on Rust. Please consider checking out my book.

Early work has begun on writing a manual. You can find it in the manual folder, or read it online.

BREAKING CHANGE ALERT: The crossterm feature is now cross_term if you are using bracket-terminal directly. It's still crossterm for bracket-lib and rltk.

IMPORTANT: If you are running the webgpu backend, you need to add resolver = 2 to your Cargo.toml file. WGPU requires it for platform selection.

What happened to RLTK?

This is RLTK, renamed because it is increasingly finding usage outside of just Roguelikes. It's also been divided into a number of crates, to make it easy to pick-and-choose the features you need.

  • rltk crate wraps bracket-lib and re-exports in the rltk:: and rltk::prelude namespace. This preserves compatibility with all existing RLTK projects.
  • bracket-algorithm-traits exposes the traits required for the various algorithm systems in other crates.
  • bracket-color is my RGB/HSV color management system.
  • bracket-geometry exposes various geometric primitives and helpers. Supports other crates.
  • bracket-noise is a port of Auburn's FastNoise to Rust.
  • bracket-pathfinding provides a high-performance A* (A-Star) pathing system, as well as Dijkstra maps.
  • bracket-random is a dice-oriented random number generator, including parsing of RPG-style dice strings such as 3d6+12.

Using bracket-lib

In your Cargo.toml file, include:

[dependencies]
bracket-lib = "~0.8"

Feature Flags

There are a few feature flags designed to aide integration with other systems:

  • specs tells various bracket-lib sub-systems to export important primitives as having Specs' Component type applied.
  • serde tells various bracket-lib sub-systems to support using Serde for serialization/de-serialization.

Performance:

  • threaded enables multi-threading on some sub-systems.

Terminal mode:

By default, bracket-lib runs in OpenGL mode (or WebGL if it detects that you are compiling for wasm32-unknown-unknown). If you want to use other rendering back-ends, disable default features and apply one of the following feature flags:

  • webgpu to use the wgpu system as a back-end, supporting Vulkan, Metal and WebGPU.
  • crossterm to use the excellent Crossterm terminal library.
  • curses to use pancurses for ncurses or pdcurses support depending upon your platform.

Sample Projects

bracket-lib's People

Contributors

abesto avatar annekitsune avatar bayou-brogrammer avatar bofh69 avatar dns2utf8 avatar enebo avatar erlend-sh avatar imoea avatar jice-nospam avatar justinbowes avatar knoellle avatar leudz avatar lnicola avatar markmccaskey avatar mcccclean avatar monadic-cat avatar oliveruv avatar patchfx avatar rugamaga avatar singalen avatar softmoth avatar spenserblack avatar spuntte avatar tannerrogalsky avatar thebracket avatar vitalyvint avatar vks avatar vojta7 avatar workingjubilee avatar ytaras avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.