In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

QuickBox2D 衝突判定

参考にさせていただいたサイト
http://blog.alumican.net/2009/07/05_024440
衝突判定の練習
Get Adobe Flash player
by hacker_kirifla 15 Mar 2010
    Embed
/**
 * Copyright hacker_kirifla ( http://wonderfl.net/user/hacker_kirifla )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/x0G7
 */

package {
	/*
	参考にさせていただいたサイト
	http://blog.alumican.net/2009/07/05_024440
	衝突判定の練習
	*/
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import com.actionsnippet.qbox.*;
    public class FlashTest extends MovieClip {
        public function FlashTest() {
            // write as3 code here..
            var sim:QuickBox2D=new QuickBox2D(this);
            sim.setDefault({lineAlpha:0,fillAlpha:0.5});
            sim.createStageWalls({fillColor:0xcccccc});
        
            
            //サークルを作成
            var i:uint;
            for(i=0;i<3;i++){
            	sim.addCircle({x:1,y:1,radius:1,fillColor:0x0000ff,fillAlpha:1,categoryBits:0x0002,maskBits:0x0007});
            	}
            	//ボックスを作成
            	var j:uint;
            	for(j=0;j<3;j++){
          			sim.addBox({x:5,y:6,width:4,height:3,fillColor:0xcccccc,categoryBits:0x0001,maskBits:0x0001,isbullet:true});  		
            		}
          
            	sim.start();
            	sim.mouseDrag();
        }
    }
}