Hi there,
im new here, playing around with corona features, i made a sample where i spaw characters on the top and transition them from top to bottom on reaching the floor i kill them. Everything works as expected but i see jitter in between and the characters look blurred, is it something that im doing wrong? or is there some problem with the aspect ratio?
config.lua
--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.ceil( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.ceil( 800 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.3, }, }, }
main.lua
display.setStatusBar( display.HiddenStatusBar ) local physics = require( "physics" ) physics.start() -------------------------------------------------------------------------------- local image\_star = nil local center\_piece = display.newImageRect( "layer-5.png",display.contentWidth,40 ) center\_piece.myName = "floor" center\_piece.x = display.contentCenterX center\_piece.y = ( display.contentHeight -20) physics.addBody( center\_piece, "static", { friction=0.5, bounce=0.3 } ) ---------------------------------------------------------------------------------- local image\_name = "star.png" local image\_group = display.newGroup() ----------------------------------------------------------------------------------- local function onLocalCollision( self, event ) if ( event.phase == "began" and (event.other.myName == "floor")) then self:removeSelf() end end ----------------------------------------------------------------------------------------------------- local function create\_body( event ) if image\_group.numChildren \>= 100 then -- Limit the number of bodies simultaneously on screen. image\_group[1]:removeSelf() end image\_star = display.newImageRect( "coin.png", 50, 50 ) image\_star:setFillColor( 0.5 ) image\_star.myName = "star" image\_group:insert( image\_star ) image\_star.x = math.random(15, display.contentWidth-15 ) image\_star.y = 0 image\_star.rotation = math.random( 360 ) physics.addBody( image\_star, "dynamic", { isSensor = true } ) image\_star.gravityScale = 0 image\_star:setLinearVelocity(0,600) -- transition.moveTo(image\_star,{y = display.contentHeight, time = 2500}) image\_star.collision = onLocalCollision image\_star:addEventListener( "collision", image\_star ) end timer.performWithDelay( 1000, create\_body, -1 ) ----------------------------------------------------------------------------
I tried it on nexus 4 as well, i see jittery objects there as well, can someone tell me what am i doing wrong.
TIA,
Nischal Y