thebest07111
Gebruiker
- Lid geworden
- 28 nov 2011
- Berichten
- 64
hallo.
ik ben bezig met een text adventure en tot nu tot nu toe heb ik dit.
nu heb ik alleen een probleem.
als je bij vraag 1antwoord b bent
en je kiest daar weer b. dus you call an ambulance and go after the suspect.
dan moet die weer een vraag gaan stellen.
dus ik dacht dan zet ik dit neer.
alleen ik weet niet waar ik dit moet neerzetten in de code.
kan iemand mij helpen.
gr
ik ben bezig met een text adventure en tot nu tot nu toe heb ik dit.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace textadventure
{
class Program
{
static void Main(string[] args)
{
Console.Write("Please enter your name ");
string name = Console.ReadLine();
Console.WriteLine("So your name is {0}", name);
Console.ReadKey();
Console.WriteLine("could you please enter your date of birth {0}", name);
string age = Console.ReadLine();
Console.WriteLine("so your name is {0} and your date of birth is {1}", name, age);
Console.ReadKey();
Console.WriteLine("{0} lays in his bed with his eyes closed, when suddently he hears a scream from outside.", name); // vraag 1
Console.ReadKey();
Console.WriteLine("What do you do?");
Console.WriteLine("a: you return to bed");
Console.WriteLine("b: you decide to take a look outside");
Console.WriteLine("c: you decide to call the cops");
char mijnchar = Console.ReadKey().KeyChar;
Console.WriteLine("");
//vraag 1 antwoorden
if (mijnchar.Equals('a'))
{
Console.WriteLine("you return to bed and you didnt know what happened");
Console.ReadKey();
Environment.Exit(0);
}
if (mijnchar.Equals('b'))
{
Console.WriteLine("You are goeing outside and you see someone beating another person");
vraag1antwoordb();
}
if (mijnchar.Equals('c'))
{
Console.WriteLine("You call the cops but the person who did this came away");
vraag1antwoordc();
}
}
public static void vraag1antwoordb()
{
//vraag 1 antwoord b
Console.WriteLine("The suspect is getting away");
Console.WriteLine("What do you do");
Console.WriteLine("a: you go after the suspect");
Console.WriteLine("b: you call an ambulance and go after the suspect");
Console.WriteLine("c: you call an ambulance and you let the suspect go");
char mijnchar1 = Console.ReadKey().KeyChar;
Console.WriteLine("");
}
public static void vraag1antwoordc()
{
//vraag 1 antwoord c
Console.WriteLine("You call the cops and explain everything, then you go back to bed");
Console.ReadKey();
Environment.Exit(0);
}
}
}
nu heb ik alleen een probleem.
als je bij vraag 1antwoord b bent
en je kiest daar weer b. dus you call an ambulance and go after the suspect.
dan moet die weer een vraag gaan stellen.
dus ik dacht dan zet ik dit neer.
Code:
if (mijnchar1.Equals('b'))
{
Console.WriteLine("You run really fast after the suspect");
Console.ReadKey();
}
alleen ik weet niet waar ik dit moet neerzetten in de code.
kan iemand mij helpen.
gr