0

我正在使用 CI 并希望在两个对象相互碰撞时显示图像,那时会显示一个特定的图像,并且该图像应该仅在发生共谋的很短的时间内显示。

它似乎是一个 poof 函数或类似的东西。但我不明白如何解决这个问题。

4

1 回答 1

0

我将为您的问题提供一些示例代码。一个动画男孩与其他对象(coll1)发生碰撞。

animatedboy.collision=function(self,event)
if event.other.name == "coll1" then
    picture.isVisible=true

function updateTime()
       display.remove(picture) or picture.isVisible=false
end
timeTaken = timer.performWithDelay( 1000, updateTime, timerTicks )          

end


animatedboy:addEventListener( "collision", animatedboy )
于 2012-07-31T07:39:30.273 回答