Unable to use if (this.pot1Sprite.isVisible()==true) in update function

Unable to use if (this.pot1Sprite.isVisible()==true) in update function
0.0 0

#1

Hi,if I use if (this.pot1Sprite.isVisible()==false) in update function, then when I run the project it works properly.

But If I just change false to true then it stops working.
means if I use if (this.pot1Sprite.isVisible()==true) my project fails to run.

This is what I want to do in update function -

if (this.pot1Sprite.isVisible() == true && rectIntersectsRect(this.pot1Sprite.getBoundingBox(), this.hammerSprite.getBoundingBox()) && !isCollide)
{
isCollide = true;
this.potAnimation();
}

please help me what is wrong with it.

Thanks.


#2

hey,
replace rectIntersectsRect with cc.rectIntersectsRect


#3

ok. Thanks problem solved.