MaximeC

Members
  • Content Count

    10
  • Joined

  • Last visited

  1. This solution does not work for me (Phaser 2.1.3). I am using SHOW_ALL, I don't have that problem with RESIZE. Any idea? Edit: actually I don't have the issue with Chrome but only with Firefox.
  2. No errors. The various JS are loaded and evaluated but after that it behaves as an empty page. I decided to give a try to crosswalk and it works like a charm.
  3. The project works perfectly in Chrome and Firefox, mobile version or desktop. But it does not work in any of the 3 modes with CocoonJS after upgrade. I don't use hasResized.
  4. I was using Phaser 2.0.7 but the upgrade to the version 2.1.3 (and dev) causes a black screen when I try to run my game with Cocoonjs. Do you have any idea about what could cause that? I tried AUTO and CANVAS. Thank you for your help.
  5. I am using onBeginContact in order to get the body that collided with the player's body (using p2): hitWall: function(wall, shapeWall, shapeShip, equation) {...}However, I don't know how to : - compute the « force » of the collision. I am currently using the speed of the player's body but I'm not sure that's a good idea (need confirmation). And the values are different between different phaser versions. - detect the part of the player's body that collided with something. Basically, if it's the bottom of the body it's fine, otherwise I need to remove life in function of the impact force. I didn't find documentation on the ContactEquation and I don't understand how to retrieve relevant data from the shapes. The other object is a wall from a tilemap. Thanks.
  6. The line: this.game.physics.startSystem(Phaser.Physics.P2JS);Should be in Game.js. I found the problem by noticing that the gravity was not taken into consideration either.
  7. I think it was 2.0.7. I finally decided to stop moving the camera anyway so I'm back with the last version.
  8. hitWall is defined the same way as create: SpaceShip.Game.prototype = { create: function() {... }, hitWall: function(wall) {... }};But I have also tried to define hitWall as a global function and also directly in onBeginContact.
  9. Hi, I have refactored my code in order to use states and classes. I now have Boot, Preload, MainMenu and Game classes. The code is cleaner but the callback associated to the onBeginContact is not called anymore. Without classes, it was working as expected. In the create of Boot.js, I set the physics engine: this.game.physics.startSystem(Phaser.Physics.P2JS);In the create of Game.js, I create my sprite and a tilemap: ...var map = this.game.add.tilemap('map');var layer = map.createLayer('Tile Layer 1');map.addTilesetImage('ground');map.addTilesetImage('star'); layer.resizeWorld();map.setCollisionBetween(1, 17);...this.ship = this.game.add.sprite(200, 200, 'ship');this.ship.animations.add('propulse', [1, 2, 3]);this.game.physics.p2.enable(this.ship, false);this.ship.body.addPolygon({}, 30, 35 , 0, 35 , 14, 5);this.ship.body.onBeginContact.add(this.hitWall, this);... hitWall is not called. I have tried using a simple function but same issue. If you need more information, please ask.
  10. Same issue for me. Fixed by using an older version of Phaser. Apparently, this might be fixed in the dev version too.