Jump to content

createMultiple not working for groups


marros1812
 Share

Recommended Posts

ok so I am trying to make weapons that my player can use to attack enemies. I've been following this http://thoughts.amphibian.com/2015/11/attacking-enemies-in-my-phaser.html.

 

When I go to run my game I am getting an error: Uncaught TypeError: weapons.createMultiple is not a function

 

As far as I can see that shouldn't be a problem, according to the docs, createMultiple should work, any ideas?

Link to comment
Share on other sites

It's definitely game.add.group() with the parentheses as CtrlAltDel points out. What happens if you do console.log(weapons) after you create the group? You should have an instance of c.Group, and in its __proto__ property (it inherits from b.DisplayObjectContainer) should be the createMultiple function.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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