Jump to content

What's the difference between add/create/make ?


bali33
 Share

Recommended Posts

Hello,

 

I'm new to phaser and I'm a bit lost with the API. For what I can see so far there is multiples way to create a Sprite or an Image :

 

game.make.sprite(0, 0, 'mummy');

game.add.sprite(0,0,'mummy');

game.create(0,0,'mummy');

 

 

Is that right ? What are the differences between them ?

 

Thank you.

 

Link to comment
Share on other sites

The first one will create the sprite but NOT add it to the world / display list, leaving it up to you to do.

 

The second one will create the sprite and add it to the game world (so it renders immediately)

 

The third one will crash :)

 

I think you meant game.world.create() - in which case that is the same as calling Group.create (because World is a Group).

Link to comment
Share on other sites

  • 1 year later...
 Share

  • Recently Browsing   0 members

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