each stage intro can have several parts, each with background image and text
export const en = {
stage0: {
part: [
{
background: "0",
text: "Your fight is our fight.\\nIt is up to the citizens \\nof the world to challenge \\nthe high score",
},
{
background: "Done",
text: "in this shooting \\ngame (STG)!",
},
],
},
stage1: {
part: [
{
background: "1",
text: "Through achieving\\nthe high score,\\nboth you and I,",
},
{
background: "Done",
text: "can come to a mutual \\nunderstanding!",
},
],
},
stage2: {
part: [
{
background: "2",
text: "The people of Earth, \\ncoming together to \\nachieve the high score, \\nis truly a beautiful thing.",
},
{
background: "Done",
text: "This beauty is something \\nthat both you as well as I,\\nboth possess!",
},
],
},
stage3: {
part: [
{
background: "3",
text: "Now, citizens of the \\nearth!\\nYou fine people who \\nchallenge the high score.",
},
{
background: "3",
text: "My high score\\nis also your high score.",
},
{
background: "Done",
text: "Let us talk to\\nour heart's content!",
},
],
},
stage4: {
part: [
{
background: "Done",
text: "Thank you for playing.",
},
{
background: "Done",
text: "This high score belongs\\n to me,\\nand it also belongs to you!",
},
],
},
stage5: {
part: [
{
background: "Done",
text: "This high score belongs\\n to me,\\nand it also belongs to you!",
},
],
},
};
text and image implementation
this.partText = this.senario[this.stageKey].part[this.partNum].text;
this.resourceBgKey =
"advBg" +
this.senario[this.stageKey].part[this.partNum].background +
".gif"
// load 'advBg0.gif"' || 'advBgDone.gif"' from 'game_ui' texture
this.bgSprite.setTexture("game_ui", this.resourceBgKey);