Arcanorum

Members
  • Content count

    120
  • Joined

  • Last visited

About Arcanorum

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    waywardworlds.com
  • Twitter
    waywardworlds

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

650 profile views
  1. The game I'm working on uses multiple zones you can move between, and only uses one state for the game world. Having a state for each zone gets messy and hard to maintain very quickly. States are more about separating different purposes in a game (a menu screen has a different purpose to a loading screen, or a cutscene), so if the functionality of the 'zones' of your game world are the same, then the playable game world should just be one state. Here's my current approach: arenas.GameWorld.prototype = { preload: function () { // Load the data for the zones. this.load.tilemap('zone-1', 'assets/zones/zone-1.json', null, Phaser.Tilemap.TILED_JSON); // ... however many zones your map has. this.load.tilemap('zone-33', 'assets/zone/zone-33.json', null, Phaser.Tilemap.TILED_JSON); }, create: function () { // Good practice to keep tilemap layers in a group. this.mapLayersGroup = this.add.group(); // Create zone 1. Change to the number of whatever zone you want to load. // Whenever a player goes through a doorway or whatever, just call createZone again and give it the number of the zone to move to. this.createZone(1); }, createZone: function (zoneNum) { // Clear the tilemap data from zoneMap, if there was any. this.zoneMap = {}; // Destroy the tilemap layers of the previous map. this.mapLayersGroup.destroy(true, true); // Create the tilemap for the zone, using the value of zoneNum to load the right zone, in the first case "zone-1", and // add the tileset images to it. This assumes every zone is using the same set of tileset images. this.zoneMap = this.add.tilemap('zone-' + zoneNum); this.zoneMap.addTilesetImage('floor', 'tileset-floor'); // ... however many tileset images your map uses. this.zoneMap.addTilesetImage('trees', 'tileset-trees'); // Add the layers to the map. These are what are displayed. this.layer1 = this.zoneMap.createLayer('layer1', undefined, undefined, this.mapLayersGroup); // ... however many layers your maps have. this.layer6 = this.zoneMap.createLayer('layer6', undefined, undefined, this.mapLayersGroup); // Resize the game world to the size of whatever the biggest layer is. this.layer1.resizeWorld(); } }; Don't worry about loading times. If your zone data is already loaded then moving from one zone to another should appear to be instant, unless your game is also doing some other crazy stuff to slow it down.
  2. I'm working on an online multiplayer game and will make frequent changes, the details of which some players will probably want to check out for themselves. What standard/widely used methods of handling the distribution of game update notes to players are there, before I possibly go ahead and waste my time creating my own update log tool. I see some games include a text file with changes when they release updates, others make forum posts. Also, do developers (especially of paid games) have a legal obligation to inform customers of changes, or it is just a courtesy?
  3. Same here.
  4. Some swanky Phaser t-shirts.
  5. What does obfuscation have to do with security? If players want to mess with the game then they are within their right to do so once you send their client the files. Without a way to truly compile our games there isn't much that can be done to stop others from working out how our code works. Minification is what you should be concerned with.
  6. WebStorm all the way baby...
  7. If the function to use as a callback is declared somewhere then just call it. What I think you are doing: var yourButton = game.add.button(x, y, 'frame', function(btn){ // Button functionality code here. }, this); What I think you should be doing: var yourCallback = function(btn){ // Your code here. } var yourButton = game.add.button(x, y, 'frame', yourCallback, this); // The function used as a callback can still be called manually, even passing in the button that you want. yourCallback(yourButton);
  8. Its ok. Try using a timer to make the bubble effect ware off after a few seconds, and try using circle physics bodies for the fish, bubble and urchin.
  9. Some other thoughts if you want to do the physics on the server.
  10. The answer that looks like the right one is usually the right one. A big advantage of pixel art is tiny file sizes, which you would lose if you scaled up the source images.
  11. This thread had been inactive for over 2 years dude. Create your own thread if you need help with something specific.
  12. Perhaps something for Phaser 3?
  13. Use Tweens. Here's how I would go about something like this. I assume you already have a path calculated to get to a desired point, for example [[0, 0], [0, 4], [2, 4], [5, 3]], where the first and second element of each array corresponds to a column and row in the grid used to generate the path. So [2, 4] would be column 2, row 4. // Create a tween to move this player smoothly to another position. // playerSprite should be the sprite object used for your player. // This first tween needs to exist to chain any other tweens on to, and to start the chain. // A tween should be added for each node in the path to follow. // When one tween ends, the next one in the chain starts, moving the player to the position of the next node. var firstTween = game.add.tween(playerSprite).to({ // path should be the array that has the path data. For example [[0, 0], [0, 4], [2, 4], [5, 3]]. // [0] gets the first element (for the first node in the path), and [0] or [1] gets the column or row to move to, respectively. // Multiply the column/row by how far apart each grid node is in your game. In this case 64 pixels. x: path[0][0] * 64, y: path[0][1] * 64} ); // Keep track of the previous tween so the next tween can be added to it. // Tween 2 is chained onto the end of tween 1, tween 3 onto tween 2, and so on. var previousTween = firstTween; // Create a tween for each node in the path. Start at i=1 as the first node is already done. for(var i=1, len=path.length; i<len; i+=1){ var nextTween = game.add.tween(playerSprite).to({ x: path[i][0] * 64, y: path[i][1] * 64 } ); // Chain the tween for this node onto the previous tween. previousTween.chain(nextTween); // Set the previous tween to this tween, ready for the next tween (if there is one). previousTween = nextTween; } // Start the first tween. When it is done, the second will start, then the first, and so on. firstTween.start();
  14. website

    Anyone? I know I'm not dreaming that there used to be a button there.
  15. If you want the overlap between the two bodies to be checked every game update then yes it should be in the update function. Otherwise you can call it just when you need it, like when some other event happens. If for example you have a player that can move into things, you could just do the overlap/collision checks when the move input is down.