I need some help here… well, i am creating a long level in my game. My level resolution is 640 x 1920 (Height x 2) and the problem is that when the camera follows the object, i can draw line only on 640 x 960 area, and my line draws on the 640 x 960 area even if i draw it somewhere at 1100 of height area… i can’t figure it out… the line and the camera are from corona docs and moveCamera is from EggBreaker example… thank you!
i added all objects to the gameGroup, yes)
In easy words: when the camera starting to follow object, my line, if i am adding it to the gameGroup, it is drawing but on ONE OF the backgrounds, i.e. 640 x 960! it is like touch area goes lower and lower… and if i am drawing on the second background, which is under the first one(for ex background1.x, y = 640, 960, background2.x, y = 640, 1200) it is drawing on the first one, which is higher!
Please, help!
[code]
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 )[/code] [import]uid: 169507 topic_id: 32361 reply_id: 332361[/import]
[import]uid: 169507 topic_id: 32361 reply_id: 131063[/import]