• Content Count

  • Joined

  • Last visited

About Langusmon

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. My game has tiles that can contain units, of which there are several types of different units. My goal is to have one group called 'units' of which all units are a sprite inside of it, with properties about what type of unit it is, and what tile it is currently on. Lets say I want to get all 'tank' unit type from tile 'T1' , would I have to use two different itererate steps? First iterating for the tile location and then iterating for the unit type I want? I cant figure out a way using iterate to search on multiple criteria at once. I am regularly going to be grabbing units from territories and doing things with them, but I was wondering if this was the best way to implement or not. I currently had the unit types separated into separate groups to start with, but that will become cumbersome to the game design if additional unit types are added. Any advice or thoughts ? Thanks
  2. The functionality behind the groups RETURN_ALL doesnt seem to be working the way that I was expecting it to. Lets say I have two groups, each represents an army, but I want to pull out certain soldiers from the groups to do combat based on their location. group1 = player1_army.iterate('location','PLACE1',Phaser.Group.RETURN_ALL); group2 = player2_army.iterate('location','PLACE2',Phaser.Group.RETURN_ALL); I was expecting group1 and group2 to be actual groups, but they dont seem to be. This doesnt work: group1.getAt(0) But this does work: group1[0] Also, if destroy an element from group1, it does actually destroy the sprite from player1_army , but the length of group1 doesnt decrease, it just stays in group1 as if nothing has changed. Based on what I can find in the documentation, is group1 just an array of sprites and not an actual group? If i wanted for an element to be removed from group1 after I destroy , do I need to do something like group1[-0] or something? Looking to understand how this is working, thanks!
  3. @caseythanks! ill take a look
  4. @samme Thanks! I will maybe just stick with the invisible sprites and groups for now because it has been working well for me. I just didnt know if it created issues long term or not.
  5. I am trying to get a 'pane' of information and clickable sprites to show up when a sprite is clicked. For example, if I had a world map, and I clicked on the United States (which is a sprite) I would like to see a pane pop up that gives me information about the sprite, and gives me things I can click on. See the below image, which each blue button being a clickable sprite that launches a function. Can I create some sort of a pane to do this, or would I create a sprite with many child objects, or would I have each thing be its own sprite and just add them to the game state in the order I want them to be overlayed on top of each other?
  6. @samme Thanks! How do I go about updating the score for a given player then? I was doing something like this before: current_player = players.iterate('name','Sally',Phaser.Return.Groups); //or whatever the exact syntax is current_player.score += 5
  7. I am creating a game that is similar to a board game, and am somewhat new to phaser. I created a 'Players' group (players =;) , created a sprite for each player and added them into the group. The sprites have an X,Y but no image assign to them, so nothing actually shows up on the game board for the players, but not I can account for them, assign and update properties, etc. For objects in the game that are not image based, is this the correct way of creating / managing these objects or is there a better way to go about this? Thanks
  8. Is there a way that I can create a drop-down like menu when I click or right click on a sprite? End goal, I wish for a player to right-click a sprite and have a couple options to choose from like: 'Attack', 'Build', 'Move', etc. I think I could do this in a super hack-ish way to make the individual options as sprites and have them overlay where the player clicks on, but it doesnt seem the best way. Thoughts?