[英]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.