Jump to content

Problem with buttons and ARCADE PHYSICS


Recommended Posts



Does the buttons have a body?


because i try this.

for(i=0;i<3;i++)        {            var bSprite=this.mainGame.gameManager.buttons[i].button;             this.mainGame.game.physics.enable(bSprite, Phaser.Physics.ARCADE);            console.log(bSprite);            bSprite.body.velocity.setTo(200,200);            bSprite.body.collideWorldBounds=true;            bSprite.body.bounce.set(1);        }

and i get this


 Uncaught TypeError: Cannot read property 'velocity' of undefined


when i check the console.log output the object doesn't have a body property or something.



im doing something wrong?

PS:Phaser v2.4.2




Link to comment
Share on other sites


  • Recently Browsing   0 members

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