just started using Phaser today after seeing Thomas Palef's lessmilk series. I completed PhotonStorm's "Make your first Phaser game" tutorial, and grabbed the skeleton, some CSS, and started to throw together a game. It's pretty barebones right now, but this is what I have.

The issue is that the game doesn't display the additional "orc" units I've requested. I used a for loop to throw five orcs around the map within the specified borders (32 pixels from the outside boundary. I even wrote a check for the x and y of each in the Update() function, but they don't appear at all.

I don't know how to move on from where I am, and I'm not sure that any of what I've written has been written the right way, you know what I'm saying? Thanks.


  • \$\begingroup\$ OP here, I think it's worth noting that the score increases by 10 without my doing anything. Are the orcs spawning to the center of the map? \$\endgroup\$
    – Spencer
    Commented Jul 3, 2014 at 4:31
  • \$\begingroup\$ You can edit your question if you have additional information. :^] \$\endgroup\$
    – Heckel
    Commented Jul 3, 2014 at 6:19
  • \$\begingroup\$ Hadn't realized that my user was still unchanged, so I had assumed I was logged out. \$\endgroup\$
    – Spencer
    Commented Jul 3, 2014 at 22:24

1 Answer 1


The issue is this part:

if (band.x > game.world.width - 64 || band.x < 64 || band.y > game.world.height - 64 || band.y < 64) { band.x = game.world.width / 2; band.y = game.world.height / 2; }

band is a Group. Groups are display objects in their own right, and their children (your orcs) are positioned relative to the x/y coordinates of the Group. Because your group starts out at x: 0, y: 0 it will fall foul of this check (band.x < 64) and be re-positioned to the middle of the game world, so all your orcs are now shifted off down to the bottom right of the screen and are forced "out of world".

I'm not sure what this part of your code is trying to actually achieve, but comment it out and you should at least see your orcs appear.

  • \$\begingroup\$ Holy crap, I don't even have know where this program is! Also, thanks for trying to help me out, because I was really, really lost trying to program that! You rock! \$\endgroup\$
    – Spencer
    Commented Oct 6, 2016 at 22:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .