Sep 01
Aug 24

KitchenSync is an ActionScript 3.0 library for sequencing animations and other time-based actions.
demo
project site
Aug 18
单纯的hittest已经不能满足精确的碰撞检测,还好flash 8里有了bitmapdata,而其中有个hittest的方法。就是用来检测复杂不规则图形的collision.
BitmapData.hitTest(firstPoint:Point, firstAlphaThreshold:uint,secondObject:Object, secondBitmapDataPoint:Point = null, secondAlphaThreshold:uint = 1):Boolean
其中firstpoint是BitmapData的左上角的x,y坐标,endpoint为碰撞物的坐标,firstAlphaThreshold和secondAlphaThreshold是对于透明区域的值,越高的话应该越精确。上面那个例子已开始没用用到bitmap的检测,我改了一下代码,就出现了那样的效果。







Recent Comments