//Variables
//Character Stat and Detail Variables
//Character Details
var Character_Name = [""];
var Age = [""];
var Alignment = [""];
var Religion = [""];
var Background = [""];
var Hair = [""];
var Race = [""];
var Height = [""];
var Gender = [""];
var Size = [""];
var Weight = [""];
//Character Stats
var Health = [""];
var Stamina = [""];
var Mana = [""];
var Strength = [""];
var Dexterity = [""];
var Agility = [""];
var Constitution = [""];
var Endurance = [""];
var Fighting = [""];
var Intelligence = [""];
var Psyche = [""];
var Wisdom = [""];
var Intuition = [""];
var Reason = [""];
var Charisma = [""];
var Physical_Beauty = [""];
//Character Abilities
var Spells = [""];
var Skills = [""];
var Abilities = [""];
var Talents = [""];
var Special_Abilities = [""];
var Ultimate_Talents = [""];
//Character Inventory
var Inventory = [""];
//Item Variables
//Character Items
var Weapon_Tool_Names = ["Basic Wand, Basic Staff, "];
var Spell_Names = [""];
var Skill_Names = [""];
var Ability_Names = [""];
var Talent_Names = [""];
var Special_Ability_Names = [""];
var Ultimate_Talent_Names = [""];
//Quest Items
var Quest_Items
//Story Variables
var Title = ["Untold Magius"];
var Story = ["You wake up with the sun shining in your eyes. \nWhat do you do? \n\nA.Stand up \nB.Sit up \nC.Check yourself for injuries"];
var Quests = ["A barren mind"];
//Unused quest names
//Awakening
//Beginnings
//Memories
//Shadows of the past
//Beach of mystery
//A forgotten past
//Land/Beach of questions
//Questioning sands
//World of lost beginnings
//Beach of unknown pasts
//A snake in our midst
//Jungles of time
//A future unseen
var CurrentArea = ("StarterBeach");
var Areas = ("StarterBeach");
//Map link? or maybe make an interactive map that auto updates later on in the game?
//Setup
//Main Canvas Setup
function setup()
{
createCanvas(600,600);
background(0);
input = createInput();
input.position(210,500);
input.size(200);
button = createButton("submit");
button.position(430,501);
}
//Text Control and Game Coloring
function draw()
{
fill(190);
rect(-1,-1,600,50);
fill(150);
rect(-1,50,600,600);
drawTitle(width * 0.5);
drawStory(width * 0.015);
}
//Title Text
function drawTitle(x)
{
textAlign(CENTER);
textSize(45);
fill(0);
text(Title, x, 36);
}
//Story Text
function drawStory(x)
{
textAlign(LEFT);
textSize(20);
fill(0);
text(Story, x, 75);
}
//Game Logic
function handleInput()
{
//Finds out what you type into the text box and turns it into a variable the game can read
var inputValue = input.value();
if (CurrentArea == "StarterBeach" && inputValue == "A")
{
Story("You stand up, and look around.");
input.value("");
}
else if (CurrentArea == "StarterBeach;")
{
Story("Please type an answer into the box at the bottom and click the submit button");
}
}
I am trying to get my game to read what you have typed into the text box at the bottom when you press submit, then clear the text box and adjust the story depending on what you have typed, but it is refusing to change the Story variable I think? Any help would be appreciated.