Note: this is all ridiculously out of date, as development proceeds at an accelerated clip. Please remind me to come back and update this once things are stable.
TextBlade is a game engine I specifically created to help run text-based JRPGs (primarily to support making them for the Games for Blind Gamers jams).
Note that you still need to write code to use TextBlade; you can leverage a lot of our base code, yes. Each game will need its own requirements and customization, so go ahead and write your own code for that.
- Run
dotnet new console --name <projectName>
to create your new project - Clone the lastest
TextBlade
repo, add it as a submodule, or copy the projects under your source directory - Add a reference to
TextBlade.ConsoleRunner
in your project - In your
Program.cs
, callnew Game().Run()
- Create a
Content
directory with agame.json
file inside; it should have aGameName
property set - Set
game.json
to copy all files fromContent
, by adding this to your.csproj
file:
<ItemGroup>
<Content Include="Content/**/*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Run your game. It should crash! Yes! Because games need a location!
Let's add a location to our game: a starting town called King's Vale.
- Modify your
game.json
and add aStartingLocation
attribute. Set the value toKingsVale
- In
Content
, create a folder calledLocations
with a file calledKingsVale.json
- In
KingsVale.json
, add aName
,Description
, and"LocationType": "Town"
attributes.
Run the game again. You should get a print statement indicating you're in King's Vale.
- Add the attribute
LocationClass
to your.json
file, and specify the class name, e.g.ThroneRoom
- Create a matching
ThroneRoom.cs
file anywhere in your project (outside ofContent
of course) - Add the
[LocationCode]
attribute to it - Add whatever custom code you like to the constructor
Note that TextBlade manages and serializes/deserializes global game-wide switches; access them via the TextBlade.Core.Game.GameSwitches.Switches
class.
TextBlade includes a credits
command. If you want to show credits, such as citation of audio resources, create a Credits.txt
file (with a capital C) in your Content directory. Typing credits will read this out.