Jump to content

weapon loading texture problem


nothing
 Share

Recommended Posts

weapon.loadTexture("weapon2");

               /\

                |

I have this, but its saying this

Quote

Uncaught TypeError: weapon.loadTexture is not a function
    at ballHitWeapon (gameex.js:246)
    at Function.<anonymous> (gameex.js:262)
    at c.Physics.Arcade.collideSpriteVsSprite (phaser.min.js:3)
    at c.Physics.Arcade.collideSpriteVsGroup (phaser.min.js:3)
    at c.Physics.Arcade.collideHandler (phaser.min.js:3)
    at c.Physics.Arcade.overlap (phaser.min.js:3)
    at colide1 (gameex.js:262)
    at Object.update (gameex.js:52)
    at c.StateManager.update (phaser.min.js:3)
    at c.Game.updateLogic

I don't know if I do anything wrong or there is different function. Thank you for all answers 

Link to comment
Share on other sites

Hmm, that's odd, IDK why it doesn't work (it should i think). Anyway this way here does work, manually destroying and re-creating the bullets with the new key:

weapon.bullets.destroy();
weapon.bullets = null;
weapon.createBullets(3, "weapon2"); // change 3 to however many max bullets you want fired...

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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