Bracket-Lib and Bracket-Terminal

In this lesson, we’ll look at the bracket library and its terminal to create a new project.

Bracket-Lib

Bracket-lib is a Rust game-programming library. It’s designed as a simplified learning tool, abstracting the more complicated aspects of game development while retaining the concepts required for more complicated games.

It’s a family of libraries, including random number generation, geometry, path-finding, color handling, and common game development algorithms.

Bracket-Terminal

Bracket-terminal is the display portion of bracket-lib. It provides an emulated console and can work with various rendering platforms, ranging from text consoles to Web Assembly, including OpenGL, Vulkan, and Metal.

In addition to consoles, it supports sprites and native OpenGL development. We can use bracket-lib to make graphical and console games.

Author’s Note: “Bracket-Lib is Open Source.” I’m the primary author of the bracket-lib library family, but like many Open Source projects, this library rests upon the shoulders of giants many users have contributed to its success.

Create a new project using bracket-lib

When we create a game that uses a game loop, the first step is to create the basic structure of the program. That means we :

  1. Create a project.
  2. Connect the project to the game engine.
  3. Display the “Hello, World” text.

Creating the basic structure ensures that we have a solid game loop foundation on which to build.

Start by making a new Rust project. Open a terminal and navigate to our source code directory. Type cargo new flappy (as you did before in Starting a New Project with Cargo). This command creates a basic “Hello, World” program.

Next is to add a dependency for bracket-lib, the engine we’ll use in this project. We covered dependency handling in Package Management with Cargo. Open Cargo.toml, and see added dependency for bracket-lib:

Get hands-on with 1200+ tech skills courses.