How to move left help

function getButton()

        local  moveLeft = display.newImageRect(“button_left.png”,100,100)

        moveLeft.x = 230

        moveLeft.y = 720

        return moveLeft

    end

    function player:tick(millisecondsPassed)

    if self.direction == nil then return false end

        if self.direction == “left” then

            self.x = self.x - self.speed

        end

    end

    function player:moveLeft()

        self.direction = “left”

    end

    function player:stopMoving()

        self.direction = nil

    end

    gameLoop:addLoop(player)

    local moveLeftButton = getButton()

    function moveLeftButton:touch(event)

        if event.phase == “began” then

            player:moveLeft()

            return true

            elseif event.phase == “ended” then

            player:stopMoving()

            return true

        end

    end

    moveLeftButton:addEventListener(“touch”, moveLeftButton)

jumpButton.x  = moveLeftButton.x + moveLeftButton.width + moveRightButton.x + moveRightButton.width + 500

    

you want your character to move in the Left direction?? easy

use the  “translate” function …look it up. then combine it with a runtime event that follows the logic 'while left button is pressed (event.phase == “began”), keep on going left and in the event.phase == “ended”, stop the runtime event function, so ur character stops too

you want your character to move in the Left direction?? easy

use the  “translate” function …look it up. then combine it with a runtime event that follows the logic 'while left button is pressed (event.phase == “began”), keep on going left and in the event.phase == “ended”, stop the runtime event function, so ur character stops too