Graphics, Camera, Action
Explore how to integrate programmer art using bracket-lib to render layered graphics in a dungeon crawler. Learn to create a camera system that centers the view on the player, enhancing game navigation and rendering efficiency. Understand managing multiple console layers and updating render functions for dynamic map visibility.
ASCII is a great prototyping tool, used even for some big-budget games, such as Rogue or Nethack. Most games employ artists to feature graphics, but that’s beyond this early stage of development; we might decide to change the game which would waste hours of the artists’ work.
In early development, it’s a much better idea to use programmer art—rough graphics designed to give an idea for the feel of a game, but without requiring a large time investment if (when) we decide to change things.
Programmer art for the dungeon
The bracket-lib library renders terminals by copying glyphs from a font file onto the terminal window. We can take advantage of this during prototyping by assigning a symbol to a tile type and replacing that character in the font file with our chosen programmer’s art. Any bitmap editor can do the job.
Another folder, resources, will hold all graphical resources needed for the game. In this case, it holds dungeon.png in the resources directory. Rather than re-create this file throughout the course, the file includes all graphics needed for the game. The following glyphs are defined:
The font file with all graphical elements defined looks like this:
The ...