title: Conditional Branch in Lua isn't working for no clear reason?
body: <p>I joined this community because it seems to be awesome, and I'm a new coder, so I'd like to try and improve well and quickly by following the advice of such a nice community. :)  </p>
  
  <p>I have a question regarding coding in lua -- right now, I'm using Corona SDK and Sublime Text 3 to code a mobile splash screen, and a title screen. I start out with titleScreen = false, so that I can run the code for the splash screen that will make it true. However, when I finish running the code for the splash screen and make titleScreen = true, the conditional branch for the titlescreen doesn't work! Please help me :( I've done tons of testing, but can't figure out where my error lies.  </p>
  
  <p>Here is my code:</p>
  
  <pre><code>titleScreen = false
  local logo = display.newImage("logo.png", 155, 275)
  logo.alpha = 0
  
  local function makeMenuTrue()
      logo:removeSelf()
      print("menu should be TRUE")
      print("WHY DOESN'T IT WORK")
      titleScreen = true  
  end
  
  local function fadeOut()
      transition.to(logo, {time = 2000, alpha = 0, onComplete = makeMenuTrue})
  end
  
  transition.to(logo, {time = 2000, alpha = 1, onComplete = fadeOut})
  
  if (titleScreen == true) then
      print("NOW IT'S TRUE")
      local mainTheme = audio.loadSound ("mainTheme.wav")
      audio.play(mainTheme)
  
      display.setStatusBar(display.HiddenStatusBar)
      local background1 = display.newImage("Title.png", 155, 275)
  
      local flare = display.newImage("flare2.png", 40, 30)
      flare.xScale = .5
      flare.yScale = .5
      local flare2 = display.newImage("flare2.png", 400, 70)
      flare2.xScale = .6
      flare2.yScale = .6
      local flare3 = display.newImage("flare2.png", 400, 70)
      flare2.xScale = .4
      flare2.yScale = .4
  
      local function moveFlare1() 
          transition.to(flare, {time=2000, x = math.random(-100, 450), y = math.random(-100, 700), onComplete = moveFlare1})
      end
      local function moveFlare2()
          transition.to(flare2, {time=2000, x = math.random(-100, 450), y = math.random(-100, 700), onComplete = moveFlare2})
      end 
      local function moveFlare3()
          transition.to(flare3, {time=2000, x = math.random(-100, 450), y = math.random(-100, 700), onComplete = moveFlare3})
      end 
  
      transition.to(flare, {time=2000, x = math.random(-100, 450), y = math.random(-100, 700), onComplete = moveFlare1})
      transition.to(flare2, {time=2500, x = math.random(-100, 450), y = math.random(-100, 700), onComplete = moveFlare2}) 
      transition.to(flare3, {time=2000, x = math.random(-100, 450), y = math.random(-100, 700), onComplete = moveFlare3}) 
  
  --[[local textbox = display.newRect(160, 214, 320, 90)
  textbox:setFillColor(.1, .1, .1, .6)
  ]]
  
      local textbox = display.newImage("MessageBack2.png", 155, 254, 320, 90)
      textbox.yScale = .7
      local textline = display.newImage("flare2.png", 0, 228)
      textline.xScale = 20
      textline.yScale = .3
      local textOption = 1
  
      local prompt1 = display.newText ("Start Game", 155, 230, "Goudy Old Style", 20)
      local prompt2 = display.newText ("Continue", 155, 255, "Goudy Old Style", 20)
      local prompt3 = display.newText ("Exit Game", 155, 280, "Goudy Old Style", 20)
      prompt1:setFillColor(0,0,0)
  
      local function textShrink()
          transition.to(textline, {time = 150, yScale = .3})
      end
  
      local function moveTextBox()
          if (textOption == 1) then
              textOption = 2 
              transition.to(textline, {time = 200, y = 253, onComplete = textShrink})
              prompt2:setFillColor(0,0,0)
              prompt1:setFillColor(1,1,1)
          else 
              if (textOption == 2) then
                  textOption = 3
                  transition.to(textline, {time = 200, y = 278, onComplete = textShrink})
                  prompt3:setFillColor(0,0,0)
                  prompt2:setFillColor(1,1,1)
              else 
                  if (textOption == 3) then 
                      textOption = 1
                      transition.to(textline, {time = 200, y = 228, onComplete = textShrink})
                      prompt1:setFillColor(0,0,0)
                      prompt3:setFillColor(1,1,1)
                  end
              end
          end
      end
  
      local function expandText()
          if (textOption == 1 ) then
              print("object 1 has been tapped????")
          else 
              if (textOption == 2) then
                  print("object 2 has been tapped????")
              else 
                  if (textOption == 3) then
                      print("object 3 has been tapped????")
                  end
              end
          end
      end
  
      transition.to(textline, {time = 150, yScale = .5, 0, onComplete = moveTextBox})
      textbox:addEventListener("tap", expandText)
      else 
          print("lmao no it's not true")
      end
  </code></pre>
  
  <p>Any help is much appreciated!!</p>