[英]Phaser3: How to react with a single member of a group
好吧,不知道你的代碼。 我會:
在create
function 中:
function create(){
...
this.mainSnowMan = undefined; // at the begining no snowman is selected
this.physics.add.collider(player, snowman, (player, currentsnowman) => {
...
this.mainSnowMan = currentsnowman; // set the snowman that collided with the player
});
...
}
documenation to the collider
function https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Collider.html
這是一個鏈接,所以 man 移相器物理示例: https://phaser.io/examples/v3/category/physics/arcade
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.