2020
10-28
10-28
javascript实现多边形碰撞检测
javascript多边形碰撞检测原理就是循环每个顶点判断是不是在多边形内constapp=newPIXI.Application({antialias:true});document.body.appendChild(app.view);constgraphics=newPIXI.Graphics();//drawpolygonconstpath=[600,370,700,460,780,420,730,570,590,520];graphics.lineStyle(0);graphics.beginFill(0x3500FA,1);graphics.drawPolygon(path);graphics.endFill();app.stage.addChild(graphics);...
继续阅读 >