在 Phaser 3 中,我使用重疊來檢查碰撞。我的代碼如下://bulletA is an array(one of the 2 arrays where collison is being checked) it contains all my bullet sprites//enemy1 is an array containing all the enemies, which I am testing for collision with my bullets. It contains all my enemy spritesthis.physics.add.overlap(bulletA, enemy1, collide1, null, this);碰撞檢測工作正常(我在碰撞時使用 console.log 進(jìn)行了測試)。但是,我需要能夠判斷敵人 1 數(shù)組中的哪個特定敵方精靈正在與我的子彈碰撞。需要發(fā)生這種情況,以便我可以對敵人播放爆炸動畫,并將該特定動畫從游戲中刪除。有什么方法可以獲取正在使用重疊的數(shù)組的特定元素嗎?
Phaser 3 陣列碰撞
慕哥9229398
2023-09-28 09:41:52