TheEmeraldMax

Untitled

Dec 5th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SelectQuit = false
  2. TipTimer = 1
  3. TitleAlpha = 0
  4. BackAlpha = 1
  5. SoulAlpha = 0
  6. RedIntensity = 0
  7. FrameFight = -1
  8. MenuMoveX = 20
  9. Seletion = 1
  10. Counter = 0
  11. Timer = 0
  12. WaitTimer = 0
  13. none = 0
  14.  
  15. -- Do not remove this or the menu wont work!
  16. require "retrostorage"
  17.  
  18. backtitle = CreateSprite("title")
  19. backtitle.layer = "Top"
  20. backtitle.x = 320
  21. backtitle.y = 240
  22. backtitle.color = {0, 0, 0}
  23. title = CreateSprite("title")
  24. title.layer = "Top"
  25. title.x = 320
  26. title.y = 240
  27. soul = CreateSprite("ut-heart")
  28. soul.layer = "Top"
  29. soul.x = 60
  30. soul.y = 114
  31. soul.alpha = 0
  32. soul.color = {1, 0, 0}
  33.  
  34. menu = CreateText({"[font:uidialog][voice:monsterfont][color:FFFFFF][instant]Start\n(Placeholder)\nTips\nToggle Intro\nCredits\nQuit"}, {906, 125}, 900, "Top", 2)
  35. menu.HideBubble()
  36. menu.progressmode = "none"
  37. menu.y = 160
  38.  
  39. Player.SetControlOverride(true)
  40.  
  41. function Update()
  42.     soul.alpha = SoulAlpha
  43.     title.alpha = TitleAlpha
  44.     backtitle.alpha = BackAlpha
  45.     Player.sprite.color = {RedIntensity, 0, 0}
  46.     if MenuMoveX > 0 then
  47.         MenuMoveX = MenuMoveX - 0.25
  48.         menu.x = menu.x - MenuMoveX
  49.     elseif MenuMoveX < 0 then
  50.         MenuMoveX = MenuMoveX - 0.25
  51.         if menu.isactive == true then
  52.             menu.x = menu.x - MenuMoveX
  53.         end
  54.         if MenuMoveX <= -40 then
  55.             if menu.isactive == true then
  56.                 menu.x = -940
  57.             end
  58.             MenuMoveX = -300
  59.             if FrameFight == -1 then
  60.                 if SelectQuit == true then
  61.                     State("DONE")
  62.                 else
  63.                     FrameFight = 0
  64.                 end
  65.             end
  66.         elseif MenuMoveX <= -29 then
  67.             if RedIntensity < 1  and SelectQuit == false then
  68.                 RedIntensity = RedIntensity + 0.1
  69.             end
  70.         end
  71.         if SoulAlpha > 0 then
  72.             SoulAlpha = SoulAlpha - 0.1
  73.             TitleAlpha = TitleAlpha - 0.1
  74.         end
  75.     elseif MenuMoveX == 0 then
  76.         if TipTimer > 0 then
  77.             TipTimer = TipTimer - 1
  78.         end
  79.         if SoulAlpha < 1 then
  80.             SoulAlpha = SoulAlpha + 0.1
  81.             TitleAlpha = TitleAlpha + 0.1
  82.         end
  83.         if Seletion > 1 and Input.Up == 1 and WaitTimer == 0 then
  84.             Audio.PlaySound("menumove")
  85.             Seletion = Seletion - 1
  86.         elseif Seletion < 6 and Input.Down == 1 and WaitTimer == 0 then
  87.             Audio.PlaySound("menumove")
  88.             Seletion = Seletion + 1
  89.         end
  90.         if Seletion == 1 then
  91.             soul.y = 169
  92.         elseif Seletion == 2 then
  93.             soul.y = 139
  94.         elseif Seletion == 3 then
  95.             soul.y = 109
  96.         elseif Seletion == 4 then
  97.             soul.y = 79
  98.         elseif Seletion == 5 then
  99.            soul.y = 49
  100.         elseif Seletion == 6 then
  101.            soul.y = 19
  102.         end
  103.         if Input.GetKey("Z") == 1 or Input.GetKey("Return") == 1 then
  104.             if Seletion == 1 and WaitTimer == 0 then
  105.                 Audio.PlaySound("menuconfirm")
  106.                 MenuMoveX = -0.1
  107.                 nextwaves = {"bullettest_bouncy"}
  108.                 -- Do not remove this or it cause a error.
  109.                 if none == 0 then
  110.                 end
  111.             elseif Seletion == 4 and WaitTimer == 0 then
  112.             Audio.PlaySound("menuconfirm")
  113. if Intro == 1 then
  114. Off()
  115. Intro = 0
  116. else
  117. On()
  118. Intro = 1
  119.             end
  120.             elseif Seletion == 5 and WaitTimer == 0 then
  121.             -- hmmm
  122.             elseif Seletion == 6 and WaitTimer == 0 then
  123.             Audio.PlaySound("menuconfirm")
  124.                 MenuMoveX = -0.1
  125.                 SelectQuit = true
  126.             end
  127.         end
  128.     end
  129.     if FrameFight >= 0 and FrameFight <= 4 then
  130.         Timer = Timer + 1
  131.         if Timer == 10 then
  132.             if BackAlpha == 1 then
  133.                 BackAlpha = 0
  134.             else
  135.                 BackAlpha = 1
  136.             end
  137.             Audio.PlaySound("BeginBattle2")
  138.             FrameFight = FrameFight + 1
  139.             Timer = 0
  140.         end
  141.     elseif FrameFight > 4 then
  142.            Audio.PlaySound("BeginBattle3")
  143.     State("ENEMYDIALOGUE")
  144.         if Intro == 1 then
  145.         EndWave()
  146.         else
  147.         SetGlobal("intro", false)
  148.         EndWave()
  149.         end
  150.     end
  151.     if WaitTimer <= 9999 and WaitTimer >= 1 then
  152.     WaitTimer = WaitTimer - 1
  153. end
  154. end
  155.  
  156. function Off()
  157. off = CreateText({"[color:FFFFFF][font:uidialog][noskip]Intro Has Toggled To \n[color:FF0000]OFF.[w:10][next]", "[noskip][next]"}, {316, 125}, 900, "Top", 2)
  158. off.HideBubble()
  159. off.progressmode = "none"
  160. WaitTimer = WaitTimer + 110
  161. end
  162.  
  163. function On()
  164. on = CreateText({"[color:FFFFFF][font:uidialog][noskip]Intro Has Toggled To \n[color:FFFF00]ON.[w:10][next]", "[noskip][next]"}, {316, 125}, 900, "Top", 2)
  165. on.HideBubble()
  166. on.progressmode = "none"
  167. WaitTimer = WaitTimer + 110
  168. end
Advertisement
Add Comment
Please, Sign In to add comment