Jump to content

stvrbbns

Members
  • Content Count

    16
  • Joined

  • Last visited

About stvrbbns

  • Rank
    Member

Recent Profile Visitors

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

  1. I have some moderately complex text-centric interface to build in addition to a rendered+physics portion. I need to use Phaser for the latter, but would like to use overlaid DOM elements for the former, especially since it sounds like updates from the reactive data sources would be easier. Am I risking not being able to build the app for mobile using CocoonJS if I use both Phaser and the DOM instead of rendering everything onto the canvas?
  2. Looks interesting. If you're looking for some design inspiration, consider comparing your creation to Ikariam and Global Triumph. Some questions to consider: Does any game feature (e.g. research) ever get finished? (i.e. is there a finite number of colonies one can have or a finite number of technologies to research) Can a game / map / server ever be finished / won? (and, if so, what forewarning is there for new players that a match/map is about to end) What prevents a single player or alliance from dominating an entire game/server? (there doesn't have to b
  3. Happily, you're welcome. I don't know without seeing all of your code, but the main problem I found out I was having (and is resolved in my example) is the necessary order of function calls: map.createLayer() layer.resizeWorld() game.physics.p2.setBoundsToWorld() game.physics.p2.createCollisionGroup()
  4. Is there a way to suggest new examples? I've created collision groups using P2 physics such that the Tilemap and the player's ship collide, the player's ship and the panda collide, and the Tilemap and the panda do not collide. However, I had trouble getting either the player's ship or the panda to collide with the world boundary. My understanding was that: Since I called "layer.resizeWorld()", I must call "game.physics.p2.setBoundsToWorld(true, true, true, true, ???)" to reset the P2 physics' world bounds. [reason: example lines 48-54] Since I called "this.physics.p2.crea
  5. rtileBody = map.layer.bodies;;s In your for-loop, you didn't actually use the increment. Also, you're never using explosionsCollisionGroup.
  6. What is the smart way to do top-down tile terrain borders in Phaser? You can't see hard-line tile edges if you look at basically any top-down game with tiles (Sid Meier's Colonization, Rimworld, Civilization 2, Heroes of Might & Magic); there are a few pixels between the tiles that get merged which makes the image as a whole look more or less seamless. Using Phaser, it looks to me like manipulating and rendering a large tile-based game map/board should probably make use of Tilemaps. However, the examples all look like the tilemap tiles do not overlap at all. I can see how you could ma
  7. See http://phaser.io/examples/v2/tilemaps/csv-map-with-p2 Run "map.replace(57,25)" either in the console, or in the code box at the end of the create() function just after the help text. map.replace() is definitely not updating collision information *on it's own*. Running "map.removeTile(1,2); map.removeTile(1,3); map.removeTile(1,4);" or "map.putTile(25,1,2); map.putTile(25,1,3); map.putTile(25,1,4);" shows that map.removeTile() and map.putTile() also do not update collision information on their own. However, calling "game.physics.p2.convertTilemap(map, layer)" again after runn
  8. There is definitely no easy way using JSON.stringify() because of the Phaser objects' inherent circular structure (e.g. reference properties such as TileMap.game, or TileMapLayer.map).
  9. I am writing a 2D, top-down persistent game with land and multi-character ships, using Phaser. Players will be able to modify the game world. It looks to me like using Phaser TileMaps is probably the most sensible way to display the ships and the land - composing each out of tiles as opposed to groups of sprites. However, in any case, I must be able to persist/save tilemap information to a store/database (currently using MongoDB). How would you, the reader, solve this? The Phaser TileMap data could be exported to a format it natively imports, but that requires looping over every til
  10. I've gotten this far: tileMapLayer_to_CSV = function (layer) { var csv = ''; for (var y = 0; y < layer.data.length; y++) { if (y > 0) { csv += '\n'; } for (var x = 0; x < layer.data[y].length; x++) { if (x > 0) { csv += ','; } csv += layer.data[y][x].index; } } return csv; }; // end tileMapLayer_to_CSV()
  11. Is there a real answer to this question? What is the best way to save/export a Phaser.TileMap as JSON to be reloaded/reinstantiated later? As of 2.4.6 - Baerlon, the public methods do not appear to contain built-in functionality for this. Phaser's accepted tile map formats (Phaser.Tilemap.CSV or Phaser.Tilemap.TILED_JSON) aren't particularly well documented themselves. I assume that the latter is "the Tiled JSON format" (based on the TMX format), but I have not figured out what the CSV format actually is. Looking at the examples (e.g. catastrophi_level1.csv), "CSV" looks to be nothin
  12. I am trying to make a menu screen with a centered title, some centered column headers, some right-aligned row labels, and some left-aligned row notes. relevant examples: Basics 06 Render Text Text Bounds relevant documentation: Phaser.Text This seems like it ought to be trivial, but none of my text alignment is working - it's all "left" all the time. I've tried declaring a non-left alignment (e.g. align:'center') on a style object before creating the text and I've tried assigning alignment to the text object immediately after creating it. Both of these methods appear to work tri
  13. My guess is that the correct call is "game.load" not "game.add" to make images available in the first place.
  14. 1) Is it strongly preferred to *not* go "back" to previous Phaser game States? For example, if dying on a level is supposed to send the player back to level selection, should the level selection and the levels themselves be coded into the same State, or is it fine to flip between game States? Thank you very much!
×
×
  • Create New...