2d text game

Blitz3D Forums/Blitz3D Beginners Area/2d text game

Chad(Posted 2005) [#1]
I would like to create just a simple 2d text game.. But I have no idea where to start, I've looked at a couple examples like the Blitzdoc sample included with B3D, but is there anything to really help me?

I'd want it something like, there's multiple choices you can choose, and so you just press what letter you want and it goes to a new direction that you chooses.

Just for an example of what I'm talking about take this for example.

Print("Hello, you walk into McDonald's hungry for something, what will you choose?)

A: A Big Mac
B: Side Salad
C: McFlurry
D: Nothing, go to something healthier

If A: Big Mac
Then Print("You die 10 years before your supposed to due to heart failure from such an unhealthy diet")
If B: Side Salad
Then Print("The salad doesn't fill you up, after eating you decide to go back and get a Big Mac. You die 10 years before your supposed to due to heart failure from such an unhealthy diet."
If C: McFlurry
Then Print ("You choose the McFlurry, the ice cream is nice and cold in your stomach on this a hot summer day, you decide to cruise around in your 1969 Ford Mustang when you come to an intersection leading either to your house or a wide open street where nobody goes."
A: Take the open road
B: Go home")
D: You choose to go somewhere healthier, after eating a much healthier meal you decide to cruise around in your 1969 Ford Mustang when you come to an intersection leading either to your house or a wide open street where nobody goes.
A: Take the open road
B: Go home")")

Do you kinda get the idea? Of course this is just an example but really what I want to be able to do..

Thanks!
Chad


Sledge(Posted 2005) [#2]
I'm doing one in C at the moment. In a nutshell, each hard-coaded location loads an previously zeroed array with the destination value (ie 1 for location001, 2 for location002 etc) for each of its choices then a subroutine basically asks "what do you want to do?" then navigates program flow from there.

Each location's details should really be held in a datafile, but there's more (immediate) freedom hard-coding stuff and you don't have to write a script interpreter. But yeah, I'd recommend formulating some sort of "engine" first, so that you can just drop the game in on top of it, which is where I'm up to. Making sure that the player can save anywhere and that game variables are easily added to the loading and saving routines were high on my list of priorities.