• Content Count

  • Joined

  • Last visited

  1. Got ya, thanks - I will keep this in mind and give it a go.
  2. Does Phaser's API offer any methods that could help to achieve this? Would it have anything to do with the StateManager? The results would end up wiping (removing all elements - including sprites/backgrounds etc.) from the current view of the canvas so it is "blank" and then to load the next state in quick succession for the player to continue in the new state.
  3. Hi there, I'm deciding on the world design for my game. What I have in mind is multiple "worlds" which have different environments and have different sizes (like <1000x600, keeping the camera the same size 800x600). These worlds will have different object groups of enemies that randomly spawn now and then. The player should be able to "jump/teleport" from environment to environment freely, keeping the state and current objects which were on the screen at the time the same when the player returns. My question is; how is this most efficiently achieved? Should it be with the use of multiple canvas objects? Or is there a way that I can save the current state of the current canvas with all objects on it and reload it at a later time? Any help with be appreciated, Thanks
  4. Perfect! Sorry for the unclear question, especially for the simple answer. I very much appreciate the example too!
  5. Hi Guys, I have a question of obtaining some form of a unique ID from a sprite / button, let me explain. I have a main menu which loads a random number of items which are clickable (at the moment they are buttons, which I'm not sure is correct or if they should be sprites). I also have a JS object which represents each of these created items (the objects are put into an array). At the moment when the Phaser button is created (in a for loop), I attach the button to the JS object when it is created, so that it is stored. As a callback function on the clickable button, I try and pass the unique ID of the object so that I can quickly access which ever object is attached to that particular button and get all the details. However, when I alert the unique ID on button click, it keeps displaying the same one, regardless of the button I click. Now I know this must be wrong and I presume I should be attaching the custom object to the button instead, but I'm not too sure how to do that. If that is also incorrect, what steps should I take to link my object to a clickable button/sprite? The idea is that once a button is clicked, a small menu dialog appears with the details etc. depending on the item clicked Many Thanks!