It’s been a time i posted here, and for the good because the game is almost finished!
I’m now in a stage of doing thorough testing so i can deliver a solid working game when it’s published in the app store.
While testing i noticed one particular problem. When in game there are two buttons, one to go back to the main screen and the other one to ga to the next level. the switching between levels works fine. But sometimes when entering a level, the buttons won’t appear. I cant find the source of this problem but i think it’s in my “drawPrevButton()” function. This is the code:
local function drawPrevButton() x = 20 y = 65 addX, addY = 25, 25 local triangle = { x,y+(addY/2), x+addX,y, x+addX,y+addY, x,y+(addY/2) } prevButton = polygonFill( table.listToNamed(triangle,{'x','y'}), isclosed, isperpixel, widthheight, widthheight, {0,0,0} ) prevButton:addEventListener( "touch", onPrevBtnRelease ) prevButton.alpha = 1 transition.to( prevButton, { time=10, alpha=1, y=0, transition=easing.inQuad } ) end
Whats weird in this function is that when i remove the line:
transition.to( prevButton, { time=10, alpha=1, y=0, transition=easing.inQuad } )
It won’t work, even when i remove the y=0 in the transition options it won’t work. By “won’t work” i mean the button does not appear in game.
Most of the times while playing the buttons appear as they should, but sometimes they won’t. There is nothing particular i’mm doing that may cause this error so i’m kind of lost on how to fix this…
Thanks,
Bram