chon27

Members
  • Content Count

    12
  • Joined

  • Last visited

  1. Thanks for you reply. I was on vacation and I couldn't try it until now. This does not work but you give me an idea of problem that I solved like this: this.physics.add.collider(this.solomon, this.movil, function() { this.onPlatform = true; }); And the other side, at update function: if(this.onPlatform && this.solomon.body.velocity.x === 0) { // In order to know direction on movement (1 to right or -1 to left) let dir = this.movil.body.newVelocity.x > 0? 1: -1; // Then sets velocity X to solomon multiplicate by the direction to make collision by both sides this.solomon.body.setVelocityX(0.001*dir); } // Reset onPlatform to set false when leaves it this.onPlatform = false; Now I have only to optimize or atomize a bit. The result in the gif. Thank you very much!
  2. Hello! I'm problems with this case; I have a map loaded from tiled with blocks that they are collisionable, some like: // Import tiled map this.map = this.make.tilemap({ key: 'fase' }); this.tileset = this.map.addTilesetImage('tileset'); this.layer = this.map.createDynamicLayer(0, this.tileset, 0, 0); // Set collision in two type of blocks this.layer.setCollisionBetween(0, 2); // Set collision between player and layer this.physics.add.collider(this.solomon, this.layer); So this part is correctly functional as can see in the gif, player walk over blocks. Then I created a new movable block like this: this.movil = this.physics.add.sprite(180, 104, 'block'); this.movil.setVelocityX(30); this.movil.setImmovable(true); this.movil.body.allowGravity = false; this.movil.setBounce(1); // Collision with the layer this.physics.add.collider(this.movil, this.layer); // And collision with the player this.physics.add.collider(this.solomon, this.movil); My problem is why the player doesn't collision with the layer when he is on the movable block. However if I walk against it while I'm on movable block, the collision does work!! (As seen at the end of gif, before he falls) Some help?
  3. *I think I have solved the problem. I had Chrome and Opera Browsers, I have uninstall Opera and the problem has disappear. Probably an Opera bug or misconfiguration.
  4. Thank you. I have activated Phaser debug and it run correctly. It run at 60-59fps all time, also during the lag. I am using the plugin Pixel Scaler and I have seen that in the original canvas has not lag but it has in the scaler canvas. Too, my brother has play my game in his computer and it has not lag anywhere. He has 4 GB RAM and I have 2GB. Could be that? It is weird.
  5. One day, without appear reason my game was getting a strange lag. The FPS is stable, but the main sprite what you manage in the game get lag in his actions. I recorded a video: http://www.youtube.com/watch?v=GULryQYi0LY&feature=youtu.be Please, anybody knows why it can happen? In the game there is not more movable objects. Thanks.
  6. Hello, I am having trouble about use 8x8 fonts. I did my png at http://arcade.photonstorm.com/ in the minimun size (8x8) and when I want to use it I receive an error: Warning: Phaser.Cache.getImage: Invalid key: "yellowFont" Error: Uncaught TypeError: Cannot read property 'hasLoaded' of undefined I think I am loading correctly the png file because I have edited my old png file with a retrofont of 16x16. What is the problem?
  7. I reply to myself: It's so easy as use: map.getTile(xBlock, yBlock, layer2, true).index
  8. I need to get the tile index of a concrete Tile of my map. I write this: console.log(map.getTile(xBlock, yBlock, layer2, true)); and I get: But if I write console.log(map.getTile(xBlock, yBlock, layer2, true).properties); I get an empty Object. If the index property exist why can't I get it? I don't find another method for this. Thanks.
  9. Thanks. About first issue it's fine, I have done it correctly. I have solved the second one using Tilemap.putTile function, then the new blocks are part of tilemap and they are acting like their own nature.
  10. I am having problems jumping in my game. 1st. I use key.isDown to determinate the jump of my sprite. But if I hold key of the jump, my character is jumping all the time. I want to push the key once and wait to another key press to do a new jump. 2nd. I draw the map with json using a file made by tiled. This tiles work with sprite.touching, they are not work by sprite.blocked. Then in my game I draw new blocks with sprite.create function and they work with sprite.blocked only. What is the difference? By the way I have some problems with sprite collisions in this new blocks, I can stick to the walls like this while hold left cursor. I have Phaser v2.0.5.
  11. Yes, it is what I need. Many thanks.
  12. Hello, I am to develop a game with NES style. I want to use the same resolution but I have encountered a problem. I have this: But it is so little in order to play in these screen. I want to reescale it but I want to maintain the pixel aspect. If I do zoom in google chrome I see that: I want to have a larger screen but seeing pixelated graphics like here: How can I to obtain these results? Thanks!