I actually like this:
if the square tomb and some Yscale value I make an animation where it breaks “animationBris”
but the problem is that the value Yscale is not interpreted accurately corona and animation may be different each time.
local square = display.newRect( 100, 100, 100, 100 ) transition.scaleBy( square, {tag = "squareTransition", xScale =-1, yScale =-1, time=1000, alpha = 0.1 } ) local function onEveryFrame( event ) print(square.yScale) if square.yScale \<= 0.1 then square:setFillColor(1,0,0) transition.cancel("squareTransition") if square.yScale ~= 0.1 then animationBris() end end end