Adding A Dialog to my game Happy Nut

Adding A Dialog to my game Happy Nut

Andrew Velez
Posted on 12/23/2018



The Dialog is currently loading the text from a txt file. It seperates the text from the characters name like so.


  • Penny: Hello
  • Penny: How are you doing?
  • Penny: Head towards the abandoned ruins in the jungle you’ll find our friends there.


  • The Code looks something like this.

    var regex = new Regex(@"Penny:" + " (?\\w+(.*))");
    MatchCollection matches = regex.Matches(textAsset.text);
    allText = new string[matches.Count];
    I loop through all the text that Penny could say incrementally till the last one shows up.

    This is a very bare bones solution i will be adding more articles on how to improve this later. For now it was a good starting point that allows me to loop through a set of instructions to the player.

    Andrew Velez
    Posted on 12/23/2018

    ...

    Recomendations

    Games for Sale

    Comments 0

    Display Name

    Email


    0 / 10