Game Development Reference
In-Depth Information
if(_input.StartsWith("use"))
{
_input = _input.RemoveSubstring("use")
int result = _input.Find("on")
if( result == -1) break; // pattern not recognized
string firstParameter = input.SubString(0, result)
string secondParameter = input.SubString(result + "on".Length(),
input.Length());
// the use function will use these strings to look up objects
Use(firstParameter, secondParemeter);
}
This code snippet assumes that all the input text is lowercase; if the player
capitalizes any letter then the function won't work! A fix for this is to process the
input string like this:
_input = _input.ToLower()
To begin a Visual Studio project for a text-adventure game, choose Console
Application rather than Windows Form Application, as is shown in Figure 11.2.
Once the console project is started, input can be read from the console
using Windows.Console.ReadLine() and output to the console using
Windows.Console.WriteLine().
A good resource for creating interactive fiction is the Inform Programming lan-
guage http://inform7.com/ . It allows the user to type in almost natural
English to describe an interactive fiction world.
Puzzle Games
Puzzle games are a good choice for a first game; they tend to need only a few
resources and they are usually relatively simple to understand. Popular puzzle
games include games such as a jigsaw, Sudoku, Boggle, Tetris, and Bejeweled.
A lot of very popular games are based around collections of puzzle games such as
the PC game 7 th Guest, the Professor Layton games on the DS, and even Brain
Training. All these games are simple to understand and play but are still chal-
lenging and fun to create.
 
Search WWH ::




Custom Search