I have this code where i am trying to add a global variable by 1 so it can display a picture but it is not working. 
init_troops.lua (globals are shown):
\_G.troops = {
blueWarrior = 1,
redWarrior = 1,
blueTank = 1,
redTank = 1,
bluePlane = 1,
redPlane = 1,
}
troops.lua(where globals are added):
local function pressWarrior (event)
if event.phase == "ended" then
\_G.troops['blueWarrior'] = \_G.troops['blueWarrior'] + 1
end
end
warriorButton:addEventListener ("touch", pressWarrior)
play.lua(where variable is read for picture to be displayed):
if \_G.troops['blueWarrior'] == 1
then warrior = display.newImage('images/warrior.png')
end
[import]uid: 34097 topic_id: 16875 reply_id: 316875[/import]