• Content Count

  • Joined

  • Last visited

About gauravD

  • Rank

Contact Methods

  • Website URL

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Okay. Fixed. Turns out Phaser uses physics.p2.pxmi (pxm inverse) to anchor a prismatic joint - BUT, physics.p2.pxm to anchor a linear spring - What is up with this ?
  2. You need to add the same angle constraints to bullet firing too. So instead of firing when the pointer is down, if (game.input.activePointer.isDown){ fire(); } you fire when the pointer is down and your sprite follows your angle constraints. if (game.input.activePointer.isDown && sprite.angle >= -90 && sprite.angle <=90){ fire(); }
  3. You are right - works flawlessly in p2.js - Seems like the Phaser P2 plugin then. Will investigate some more today and get back to you!
  4. Like @casey said, animations (tweens) and timers will help you. An example -
  5. Hi Casey. Children of a group will be rendered in the order in which they are added (unless of course you change the order with functions like sendToBack()). Because you add the background first, it will be rendered before everything else (so you don't need the call to sendToBack() on bg), and the text should appear on top - Perhaps, you are changing the group's order somewhere else in your code?
  6. Oh right! I stand corrected
  7. Cool Your fiddle was using an older version. You can always check what version you are using - Phaser prints it in your console! Um, depends on how you are including it. It might look like <script type="text/javascript" src=""></script> //Or If you have downloaded the source, it could be something like: <script type="text/javascript" src="../libs/phaser/phaser.min.js"></script> You can update to phaser-ce by 1. Grabbing the latest source from and including it in your project ( with something like <script type="text/javascript" src="../libs/phaser/phaser.min.js"></script>) OR 2. Pointing to a newer phaser source with <script type="text/javascript" src=""></script>
  8. It does render quads. But it uploads the entire buffer every frame - come to think of it, this will usually be necessary if all/most objects in the scene move. I was working on a game where a few hundred quads would remain static throughout and other objects (quads) moved. Uploading just the bufferSubData() helped me with performance significantly! Also, are you using multi texture batching? You might also want to try Phaser 2.6.2; Apparently, it performs much better than the current ce version. PS Could you please check the number of draw calls you get with webGL?
  9. Hi. Prismatic and Spring joints in p2js seem pretty straightforward. I was wondering why using constant rest length, stiffness and damping for a spring would change its behavior when a body's local anchor is changed. Fiddle: (phaser/p2js template from inkfood) From the fiddle, all the springs use share the same parameters except the local anchor of body A. Why do the springs behave differently? :/
  10. Hey. Poor webGL performance could be due to a few things aside from phaser.debug. Because your scene is large, it might be due to Phaser(pixi) uploading entire buffers on the GPU every render frame. Perhaps, some profiling could help you? Check out #356!
  11. Hi Tom. Camera follow has been fixed in a newer version of Phaser. You should update to either phaser-ce or 2.6.2 Because you move the camera around, the pointer's arctan to the player will not be computed correctly if you use the pointer's local (x,y). You need the arctan from the pointer's (x,y) in world coordinates. Passing the world to moveToPointer(), will use the pointer's world coordinates (this is not intuitive, I know). game.physics.arcade.angleToPointer(player, game.input.activePointer,; With these changes in, check out :
  12. Hi wexing. What do you mean by overflow? The ball slightly entering the right_hoop ? This might be due to tunnelling. AFAIK, p2js only partially supports Continuous Collision Detection, if at all. Making the hoop rects slightly wider, will help -
  13. Hey Teonnyn. You get this behavior because the point (X, Y) is on the physics world boundary. If your body is set to collide with world boundaries (which it is by default), and you create it on the boundary, the collision will force the body out with an impulse. set the variable center to false, and you will see the ball behaving like it does in your code. If you want your ball to come in from outside, make the world bigger
  14. Looking good Costin! Aside from the webpack boilerplate, the prefab and helper templates will be helpful for new phaser+typescript developers
  15. Perhaps, you are looking for Try,;