Ok, i guess you already have a console done that accepts input. First thing you need to do is tell the console to check if dodge has been typed. Now as you know the word 'dodge' always ends in an 'e' then you could tell the input of the console when e is typed check to see if dodge has been input e.g
public event EventHandler Dodge;
public void ConsoleInput(string letter)
{
inputstring = inputstring + letter// this is where you normaly add the letter to the input string of the console
if (letter == "e" && inputstring == "dodge")// you could use just one check but its slightly quicker to only check when the e is typed
{
if (Dodge != null)// check that somone this listening for the event
{
Dodge(this, Eventargs.null);// call the event
}
}
}
Now in whatever is listening for the event, e.g the player you need to hook up to the event
Console.Dodge += new EventHandler(DoDodge);// console being the console that is calling the event, DoDoge is the method to doge, this gose into the constructor or initialization
private void DoDodge(object sender, e EventArgs)//you need these paramiters always for event methods
{
...// Do the doge logic here
}
hope this helps