Adding Aesthetic


It's early on into development, but I decided to improve the overall appearance of my game. I already created animated text typing, now I wanted to create a title screen for my intro state. I decided to use an ASCII text site to generate the title page. However, printing ASCII art to the console can be challenging, which is where the verbatim string literal character '@' came in handy. By using this character, I was able to create a string that preserved the original formatting, such as white spaces and escape sequences, exactly as they were written in the code. The result was fantastic and can be seen in the images above.

Next, I wanted to add some color to the world map. The map started as a 2D array of characters and added colors based on the characters being printed, which worked well initially. However, the code became more complex as I added more colors and backgrounds. To avoid reusing the same code repeatedly, I created a Tile class. This class includes a variable for the foreground color, background color, and character, as well as a Print method that sets the colors and prints the character to the console. I even created a deep water tile in case I add rafts or small boats for water travel. To implement the new Tile class I changed the map to an array of Tiles.

I then used the Tile class to add color to the dungeons, changing dungeons to a 2D array of Tiles. It was simple and straightforward since I had already created the class, I even added tiles for different types of money and treasure the player can collect. Images of the results can be found above, and tutorials will be provided soon!

I hope you enjoyed this article and that you come back for the next one!

Leave a comment

Log in with itch.io to leave a comment.