L10-build-user-name-gen.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * project set up
  3. */
  4. let words: string[] = []
  5. scene.setBackgroundColor(8)
  6. game.setDialogFrame(img`
  7. ..bbbbbbbbbbbbbbbbbbbb..
  8. .b11bb11bb11bb11bb11bbb.
  9. bbb11bb11bb11bb11bb11b1b
  10. bb1bbbbbbbbbbbbbbbbbb11b
  11. b11bb11111111111111bb1bb
  12. b1bb1111111111111111bbbb
  13. bbbb1111111111111111bb1b
  14. bb1b1111111111111111b11b
  15. b11b1111111111111111b1bb
  16. b1bb1111111111111111bbbb
  17. bbbb1111111111111111bb1b
  18. bb1b1111111111111111b11b
  19. b11b1111111111111111b1bb
  20. b1bb1111111111111111bbbb
  21. bbbb1111111111111111bb1b
  22. bb1b1111111111111111b11b
  23. b11b1111111111111111b1bb
  24. b1bb1111111111111111bbbb
  25. bbbb1111111111111111bb1b
  26. bb1bb11111111111111bb11b
  27. b11bbbbbbbbbbbbbbbbbb1bb
  28. b1b11bb11bb11bb11bb11bbb
  29. .bbb11bb11bb11bb11bb11b.
  30. ..bbbbbbbbbbbbbbbbbbbb..
  31. `)
  32. game.showLongText("make a username", DialogLayout.Bottom)
  33. // array set up
  34. let favAnimal = game.askForString("What is your favorite animal?", 8)
  35. // index 0
  36. words.push(favAnimal)
  37. let favFood = game.askForString("what is ur fav color", 8)
  38. // index 1
  39. words.push(favFood)
  40. let favColor = game.askForString("what is ur fav shape", 8)
  41. // index 2
  42. words.push(favColor)
  43. let favCandy = game.askForString("meow", 8)
  44. // index 3
  45. words.push(favCandy)
  46. let birthdayMonth = game.askForNumber("what us ur birthday month", 2)
  47. // index 4
  48. words.push(birthdayMonth.toString())
  49. let birthdayDay = game.askForNumber("what us ur fav number", 2)
  50. // index 5
  51. words.push(birthdayDay.toString())
  52. let favNum = game.askForNumber("mmmeooowww", 4)
  53. // index 6
  54. words.push(favNum.toString())
  55. let userName = [[words[1], words[2], words[3]], [words[0], words[4], words[5]], [words[3], words[6], words[1]]]
  56. // display usernames
  57. game.showLongText("Username option: " + userName.join(""), DialogLayout.Full)
  58. for (let i = 0; i < userName.length; i++) {
  59. game.showLongText("Username option " + (i + 1) + ": " + userName[i].join(""), DialogLayout.Full)
  60. }
  61. music.play(music.melodyPlayable(music.baDing), music.PlaybackMode.UntilDone)
  62. game.reset()