Jump to content

createMultiple not working for groups


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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