[media]http://www.youtube.com/watch?v=MuMKrG7T1jY[/media]
With the new onComplete functionality, setting up simple camera oscillations is easy.
moveBack2 = function(event) print("done1", event.levelPosX, event.levelPosY, event.layer) mte.moveCameraTo({levelPosX = player.getLevelPosX() + 48, levelPosY = player.getLevelPosY() + 48, time = 1500, layer = event.layer, easing = "inOutQuad", onComplete = moveBack1}) end moveBack1 = function(event) print("done1", event.levelPosX, event.levelPosY, event.layer) mte.moveCameraTo({levelPosX = player.getLevelPosX() - 16, levelPosY = player.getLevelPosY() - 16, time = 1500, layer = event.layer, easing = "inOutQuad", onComplete = moveBack2}) end mte.moveCameraTo({levelPosX = player.getLevelPosX() + 48, levelPosY = player.getLevelPosY() + 48, time = 1000, layer = 1, onComplete = moveBack1}) timer.performWithDelay(50, function() return mte.moveCameraTo({levelPosX = player.getLevelPosX() + 48, levelPosY = player.getLevelPosY() + 48, time = 1000, layer = 2, onComplete = moveBack1}) end) timer.performWithDelay(100, function() return mte.moveCameraTo({levelPosX = player.getLevelPosX() + 48, levelPosY = player.getLevelPosY() + 48, time = 1000, layer = 3, onComplete = moveBack1}) end) timer.performWithDelay(150, function() return mte.moveCameraTo({levelPosX = player.getLevelPosX() + 48, levelPosY = player.getLevelPosY() + 48, time = 1000, layer = 4, onComplete = moveBack1}) end) timer.performWithDelay(200, function() return mte.moveCameraTo({levelPosX = player.getLevelPosX() + 48, levelPosY = player.getLevelPosY() + 48, time = 1000, layer = 5, onComplete = moveBack1}) end)