Jump to content

How to handle groups and sprites in tiled games


catigator
 Share

Recommended Posts

I'm making a small puzzle game, and I'm juste wondering if there is a nice "Phaser" way of doing this stuff, or if there's a commonly used standard. Basically I want to move the player and some enemies around on a grid, and I want to specify x and y values depending on which grid point they are in (having it all laid out in a nice matrix will make writing gamerules easier). However I want the sprite.x and sprite.y values to be 32 * x if the grid position is x and each sprite is 32 pixels - what's the best way to implement this? Updating both the grid x and sprite x every time I move (which will not really be a nice way to do it), or looping through each object in update() to update the sprite.x values? Or some other Phaser specific solution?

Thanks,

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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