2

ここで助けが必要です...まあ、私は自分のゲームで長いレベルを作成しています。私のレベル解像度は1280x960(高さx 2)ですが、問題は、カメラがオブジェクトを追跡すると、640 x 960の領域にしか線を描画できず、線を描画しても640x960の領域に線を描画することです。高さエリアの1100のどこか...私はそれを理解できません...ラインとカメラはコロナドキュメントからのものであり、moveCameraはEggBreakerの例からのものです...ありがとう!

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 )
4

1 に答える 1

1

電話すると

fileTwo:stop();

を呼び出していますがtransition.cancel( null )、この関数を null で呼び出すと、奇妙な動作が発生するようです。

これを入れるとfileTwoに

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

問題はなくなりました。

于 2014-05-15T22:20:38.007 に答える