I am trying to create a Text Adventure game, but i am having problems trying to have both the title for the game and the game text display at the same time. Is there a way to create different text, so that i can have Story be a variable that displays near the center of the screen, while still having custom background colors, and a seperate Title variable that displays at the top of the screen?
//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);
textAlign(CENTER);
drawWords(width * 0.5);
}
}
//Story Text
{
function drawWords(x)
{
textSize(35);
fill(0);
text(Story, x, 300);
}
}
//Game Title Text
{
function drawWords(x)
{
textSize(45);
fill(0);
text(Title, x, 36);
}
}
}
so should i just change one of them to
function drawWords(y) ?
and yeah, im using the extra {} brackets to help group different sections of the code together so its easier for me to find things while editing the code.
imho:
in this case exactly this stopped processing from showing a proper error message (duplicate function name not allowed) and stopped you from being able to work further on it