I did solve it in a way and it is working. I was using the isVisible method and switching between the two sprites. But now I cannot apply physics to object “player” … 
--HODI local walkRight = { width=106, height=138, numFrames=11, sheetContentWidth=212, sheetContentHeight=828 } local myImage = graphics.newImageSheet( "images/hoja.png", walkRight) local sequenceRight = { { name = "right", start=1, count=5, time=400 }, } local sequenceLeft = { { name = "left", start=7, count=5, time=400 }, } local right = display.newSprite( myImage, sequenceRight ) right.x = width/2 + 150 right.y = height-75 right.isVisible = false right:play() local left = display.newSprite( myImage, sequenceLeft ) left.x = width/2 left.y = height-75 left.isVisible = false left:play() --definiram class, da lahko na tega potem apliciram fiziko local player = {} player.left = left player.right = right player.switch = { 1, 2 } playerShape = { 0,-37, 37,-10, 23,34, -23,34, -37,-10 } player.change = function() if player.switch == 1 then player.left.isVisible = true player.right.isVisible = false else player.left.isVisible = false player.right.isVisible = true end end physics.addBody(player, "dynamic", { density=3.0, friction=0.5, bounce=0.3, shape=playerShape } ) local dx = 4 local function turn(self) if ((self.x \< 47) or (self.x \> width - 47)) then dx = dx \* -1 end end local function animation() left.x = right.x right.x = right.x + dx if (dx\>0) then player.switch = 2 else player.switch = 1 end player.change() turn(right) end Runtime:addEventListener( "enterFrame", animation )