ASCII game in XNA?

Started by
1 comment, last by Jos 10 years, 11 months ago

I want to make a little game in XNA like Dwarf Fortress but I don't know anything about how to draw ASCII graphics, should I use array and text import file, or it's better make ASCII with a drawing software and use png file in XNA?.

Advertisement

Hey there Endzon,

You can draw glyphs in XNA by creating a SpriteFont (right click your content project -> Add New Item -> Sprite Font) and then rendering it with SpriteBatch's DrawString method. Note that you may need to adjust the CharacterRegions in the resulting xml file in order to get all the ASCII characters you want. In terms of structure, you could probably structure the level like a tilemap, where each tile is a string instead of an image. It's then just a matter of looping over the tiles and rendering them with DrawString.

Hey there Endzon,

You can draw glyphs in XNA by creating a SpriteFont (right click your content project -> Add New Item -> Sprite Font) and then rendering it with SpriteBatch's DrawString method. Note that you may need to adjust the CharacterRegions in the resulting xml file in order to get all the ASCII characters you want. In terms of structure, you could probably structure the level like a tilemap, where each tile is a string instead of an image. It's then just a matter of looping over the tiles and rendering them with DrawString.

Thanks, I will practise with that technique and I discovered a usefull program for paint in ASCII: https://code.google.com/p/ascii-paint/

This topic is closed to new replies.

Advertisement