Graphics, Camera, Action

Hands-on Rust — by Herbert Wolverson (48 / 120)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Building a Dungeon | TOC | Wrap-Up 👉

ASCII is a great prototyping tool — even used for some full games such as Rogue or Nethack. Most games feature graphics, but this early in development isn’t the right time to find an artist and make beautiful content — you might decide to change the game and waste hours of the artist’s work. In early development, it’s a much better idea to use Programmer Art — rough graphics designed to give you an idea for the feel of a game, but without requiring a significant time investment if (when) you decide to change things.

In this section, you’ll implement graphical layers — so the player stands on top of the floor rather than replacing it. The graphics are much larger than simple ASCII glyphs, so you’ll need to reduce the visible portion of the map — without sacrificing size or map quality. You’ll solve this issue by creating a camera.

Programmer Art for the Dungeon

bracket-lib renders terminals by copying glyphs from a font file onto the terminal window. You can take advantage of this during prototyping by assigning a symbol to a tile type and replacing that character in the font file with your chosen programmer art. Any bitmap editor can do the job — I use The Gimp.[46]

Create a new directory named resources in your project’s root directory. This directory will hold all graphical resources needed for the…

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.