Hello people 
i have a code that make what i need, but have one point that i need to change i have a button that is red and create block then touched, and have a other button that should stop the event listener of this red button, see that:
display.setStatusBar( display.HiddenStatusBar )
local game\_stop = function()
local gameactive = true
local paused = false
local pause\_button= display.newRect( 250, 20, 50, 50 )
pause\_button:setFillColor( 255, 255, 255, 100 )
local function pause()
if paused == false then
gameactive=true
elseif paused == true then
gameactive=false
end
end
pause\_button:addEventListener("tap", pause)
local spawner = display.newRect( 20, 3, 20, 25 )
spawner:setFillColor(150, 0, 0)
-- physics.addBody(spawner, "static", {isSensor = true})
local function spawnMyObject (event)
if event.phase == "began" then
block1 = display.newRect( 50, 50, 50, 50 )
block1:setFillColor( 255, 255, 255, 100 )
-- physics.addBody(block1, "kinematic", { density=2, friction=0, bounce=0})
end
end
if gameactive==true then
spawner:addEventListener("touch", spawnMyObject)
elseif gameactive==false then
spawner:removeEventListener("touch", spawnMyObject)
end
end
game\_stop()
i need to when i touch on the pause button i need to change the active game variable, true or false, because when i do the if statement it will check the value of gameactive variable, and is allow to create the block or no
Thanks for all the helpers [import]uid: 26056 topic_id: 16931 reply_id: 316931[/import]
the if statement only see that i declarate the variable gameactive=true on top of code, and dont see my function pause(), really need help because it will very used and important on the game 