Version 2011.703 (2011.12.8)
I’m in the advanced stages of developing a scrolling graphics game and I’m having real problems in getting smooth graphics.
The graphics move smoothly, then there are sudden jumps. I see this on the simulator (running on Macbook Pro) as well as on my Android device (Samsung Galaxy S). I’m worried that I will not be able to release the game until this problem is fixed.
In debugging the code, I’ve stripped away the code down to the absolute minimum to demonstrate the problem. The same problem occurs if I use transition.to() rather than explicit animation. I’m getting the impressions that there are some behind-the-scenes activities that are delaying the actual time that the graphics are updated. I’ve eliminated the possibility that frames are being skipped.
Any help would be really really appreciated.
Anthony
Nevis Games
------------------Setup-------------------------------
local fgspeed = 0.2;
local F = {};
local k;
for k = 1, 8 do
F[k] = display.newCircle(display.contentWidth*k/4,
display.contentHeight/2, 50);
F[k]:setFillColor(255, 255*k/8, 100);
end
------------------Frame event-------------------------------
local tPrevious = system.getTimer()
local function newFrame(event)
local tDelta = event.time - tPrevious
tPrevious = event.time;
–print(tDelta);
local k;
for k=1, 8 do
F[k].x = F[k].x - fgspeed*tDelta;
if (F[k].x + F[k].contentWidth/2 < 0) then
F[k]:translate(2*display.contentWidth, 0);
end
end
end
Runtime:addEventListener(“enterFrame”, newFrame); [import]uid: 87194 topic_id: 18981 reply_id: 318981[/import]