如何在Phaser中使两组重叠?

时间:2018-12-14 17:12:49

标签: javascript phaser-framework

我想在表情符号碰到红色矩形时禁用它的主体。不幸的是,我无法(至少)成功记录两组(表情符号和红色框)之间的重叠。我没有任何错误,当我登录两个组时,它提供了正确的内容。如果它碰到一个红色框,它什么也不会做。我已经搜索了两个小时,但似乎找不到我在做错什么。有人可以帮我吗?任何帮助深表感谢!

this.group1 = this.physics.add.group();
this.redBoxDivider = this.physics.add.staticGroup();
    
console.log(this.group1);
  /*returns a dynamic group with the numbers of arrays, every second, there's one more */ 
console.log(this.redBoxDivider);
   /*returns a static-group with one sprite, so the image is in the array*/
      
 this.physics.add.overlap(
    this.group1,
    this.redBoxDivider,
    this.test,
    null,
    this
    );
    
    
  test() {
    console.log('test');
    this.group1.disableBody(true);
  }    
    

0 个答案:

没有答案