0
我創建了2個精靈對象,並希望檢查他們是否碰撞,但它似乎並沒有工作。gamequery碰撞檢測doesnt反應
我的代碼:
創作精靈:**
.addGroup("flying", {width: 366, height: 254})
.addSprite("flyinganimation",{animation: flight,
posx: 0, posy: 0, width: 366, height: 254})
.addGroup("obstacles", {width: 169, height: 67})
.addSprite("obstaclenames", {animation: obstacleimage,
width: 169,height: 67,
posx: 300,
posy: 400})
回調函數中的循環代碼:**
var collision = $("#flying,.group").collision("#obstacles,.group");
if (collision > 0)
{
document.write ("collision");
}