Finishing the Story
Finishing the Story
Keep adding to your game by adding more variables, questions, and concatenating strings.
- Add more lines to your story
- Playtest the game every time you add a new set of variables and strings
Tips and Tricks
Use Variables More Than Once
Variables can be used more than once — just use concatenation between strings where you want to include the word(s).
Example Code |
---|
local story = "In a tree on a hill lives the great wizard " .. name1 .. ". " .. "Every morning, " .. name1 .. " loves eating a giant bowl of honey roasted " .. food1 .. " . "
|
Result |
In the tree on a hill lives the great Wizard Sameth. Every morning, Sameth loves eating a giant bowl of honey roasted potatoes. |
Add Line Breaks
Line breaks can be added by typing \n
in a string .
With One Line Break
Example Code |
---|
local story = "In a tree on a hill lives the great wizard " .. name1 .. ". " .. "\nEvery morning, " .. name1 .. " loves eating a giant bowl of honey roasted " .. food1 .. " . "
|
Result |
In the tree on a hill lives the great Wizard Sameth. Every morning, Sameth loves eating a giant bowl of honey roasted potatoes. |
With Two Line Breaks Together
Example Code |
---|
local story = "In a tree on a hill lives the great wizard " .. name1 .. ". " .. "\n\nEvery morning, " .. name1 .. " loves eating a giant bowl of honey roasted " .. food1 .. " . "
|
Result |
In the tree on a hill lives the great Wizard Sameth.
Every morning, Sameth loves eating a giant bowl of honey roasted potatoes. |
Previous Add a Second Question Next Third Challenge