Jump to content

Collide/Overlap inside conditional


Dobrado
 Share

Recommended Posts

Hello! :)

 

I'm trying to make a game like this: http://dagobah.net/flash/BEavis_butthead_spit.swf

 

But I have a problem:

 

I have three lines with enemies, but when the powerBar are inside line 2, I need to kill only the enemies inside this line and not inside line 1.

 

I trying use this conditionals, but collide do not work. :/

        if (powerBar.body.y >= 60 && powerBar.body.y <= 210) {            //Line 1        } else if (powerBar.body.y >= 210 && powerBar.body.y <= 350) {           // Line 2            this.physics.arcade.collide(shoot, line2, this.lin2Collide, null, this);        } else if (powerBar.body.y >= 350 && powerBar.body.y <= 500) {            //Line 3        } else {        }
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...