supreme-committee / text-adventure

UCSC CMPS 115 Project
0 stars 0 forks source link

Allow user to insert variables into text elements #59

Closed mgrijalva closed 10 years ago

mgrijalva commented 10 years ago

This is a feature I forgot about. The user could do something like this:

<tile>
    <var>
        <name>fname</name>
        <value>Michael</value>
    </var>
    <var>
        <name>haverock</name>
        <value>true</value>
    </var>
    <var>
        <name>gold</name>
        <value>750</value>
    </var>
    <text>Hello {{fname}}. You have {{gold}} pieces of gold and haverock is {{haverock}}</text>
    <link>
        <file>start.xml</file>
        <text>Go</text>
    </link>
</tile>

It would look like this when displayed:

Hello Michael. You have 750 pieces of gold and haverock is true

I almost have it working. I'm just posting this so everyone will know about this new feature.