JordanSchuetz

Members
  • Content count

    5
  • Joined

  • Last visited

  1. Phaser Retina Resolution in Android Webview

    Use Cordova
  2. Making a Realtime Multiplayer Game with Phaser

    All of the code I wrote is open source and up on GitHub and I'm using the PubNub free tier. The messages are usually received in less than 50ms. Test out the real time functionality by opening up two browsers and trying yourself. You can even play on your mobile device. Also thanks for the kind words.
  3. When I started to play around with the Phaser API, I wanted to tackle the challenge of creating a realtime game with multiple players. I decided to use the PubNub multiplayer framework for the realtime functionality and it worked extremely well. I put my entire project up on Github and you can try it out by clicking HERE (open up two browser windows to test real time functionality). PubNub provided me with low latency with message delivery happening in less than 250ms and Phaser is super lightweight which allows it to work in mobile browser and even on low end computers. The entire project took me a few weeks to develop but most of that was just optimizing the game to send the least amount of messages possible. I wrote a step by step tutorial if you want to try to make this yourself in Phaser, you can checkout the tutorial HERE.
  4. Phaser Physics Body's Teleporting Into Eachother

    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.game.physics.arcade.collide(otherplayer, 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") }
  5. 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 this.game.physics.enable(sprite); sprite.body.allowGravity = false; sprite.body.immovable = true; this.game.debug.body(sprite); }; And here is the code for the players: PlayState._spawnCharacters = function (data) { this.hero = new Hero(this.game, 10, 10); this.hero.body.bounce.setTo(0, 0); window.globalMyHero = this.hero; window.globalOtherHeros = this.otherHeros = new Map(); this.game.add.existing(this.hero); sendKeyMessage({}); }; And here is the collide function between the platform and all of the global players: this.game.physics.arcade.collide(otherplayer, 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.