• Content count

  • Joined

  • Last visited

  1. Hi so I wasn't able to find a great solution, however I came up with a little hack that works okay: var collidePlayer =, this.hero, null, null, this); if(this.hero.y > 526){ this.hero.position.set(this.hero.x, 525); console.log("set") }else if(otherplayer > 526){ this.otherplayer.position.set(otherplayer.x, 525); console.log("set2") }
  2. Hello, I'm working on a realtime multiplayer game and I'm running into a problem with the physics that I'm unsure how to correct. Basically when one player jumps on top of the other from a high distance, it pushes the other player through the platform and the player gets stuck there. Here is the code for the platforms: PlayState._spawnPlatform = function (platform) { let sprite = this.platforms.create( platform.x, platform.y, platform.image); // physics for platform sprites; sprite.body.allowGravity = false; sprite.body.immovable = true;; }; And here is the code for the players: PlayState._spawnCharacters = function (data) { this.hero = new Hero(, 10, 10); this.hero.body.bounce.setTo(0, 0); window.globalMyHero = this.hero; window.globalOtherHeros = this.otherHeros = new Map();; sendKeyMessage({}); }; And here is the collide function between the platform and all of the global players:, this.platforms, null, null, this); Does anyone have any recommendations on how I can make the players not get stuck in other physics objects? Thank you for the help.