I need help with storing the string value (player name) to be able to pass it onto another world (to display it as the player's name while the game is ongoing).
This is where it gets tricky, i cant seem to pass the updated value of playername to String name
public String forInput()
{
String name = "";
key= Greenfoot.getKey();
if (Arrays.asList(alphabet).contains(key) && input.length() == 1)
{
if (playername == null)
{
playername = "";
}
playername += input;
displayText(playername, x, y, 30);
name = playername;
}
return name;
}


