2012-10-15 71 views
2

我需要一些帮助在这里......好吧,我在我的游戏中创造了一个长期的等级。我的水平分辨率是1280 x 960(高x 2),问题是当相机跟随物体时,我只能在640 x 960的区域绘制线条,即使绘制了它,我的线条也会绘制在640 x 960的区域上某处在1100高度的区域......我无法弄清楚......线路和相机来自日冕文件,moveCamera来自EggBreaker例子......谢谢!(Corona SDK)的区域

W = display.contentWidth; 
H = display.contentHeight; 

local function createPlatform(event) 
if (event.phase == "began") then 
     if(line) then 
      line.parent:remove(line); 
     end 
     x = (event.x - (W/2 - 80)); 
     y = (event.y - (H/2)); 
     line = display.newLine(W/2 - 80, H/2, event.x, event.y) 
     line.width = 5; 
     physics.addBody(line, "static", {shape = {0, 0, x, y}}); 
     line.isBullet = true; 
    end 
    if (event.phase == "moved") then 
     x = (event.x - (W/2 - 80)); 
     y = (event.y - (H/2)); 
     if (line) then 
      line.parent:remove(line); 
     end 
     line = display.newLine(W/2 - 80, H/2, event.x, event.y) 
     line.width = 5; 
     physics.addBody(line, "static", {shape = {0, 0, x, y}}); 
     line.isBullet = true; 
    end 
    if (event.phase == "ended") then 

    end 
end 

Runtime:addEventListener("touch", createPlatform) 



--Camera follows bolder automatically 
local function moveCamera() 
    if (obj.x > 320 and obj.x < 960) then 
    gameGroup.x = -obj.x + 320 
    end 
end 


Runtime:addEventListener("enterFrame", moveCamera) 

回答

1

当你调用

fileTwo:stop(); 

要调用transition.cancel(null),似乎调用带有空原因怪异的行为此功能。

如果你把这个,就FileTwo传送

if(self.AnimationTransition ~= nil) then 
    transition.cancel(self.AnimationTransition) 
end 

问题已经一去不复返了。