Jump to content

Create Group with Rectangles


Youle
 Share

Recommended Posts

Hi,

I'm creating a Tower Defense prototype using a class I created as towers (itself based on two Phaser.Rectangle with one darker to create some volume).

I'd like to sort these towers by y axis. I have to create them on a group and... I can't find how to create something else than spritesheets on Phaser.Group.

 

myGroup.length show '2' (I created 2 towers for the examples) but they don't display on game container.

 

Have you an idea ?

 

Thank you, 

Youle

Link to comment
Share on other sites

Glad you worked out a solution, for future reference have you looked at the documenations for group.add, I'm still not totally sure what your problem was but maybe this will help

 

"Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object. The child is automatically added to the top of the Group, so renders on-top of everything else within the Group. If you need to control that then see the addAt method"

 

http://gametest.mobi/phaser/docs/Phaser.Group.html#toc24

Link to comment
Share on other sites

  • 3 weeks later...
 Share

  • Recently Browsing   0 members

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