Doug

Members
  • Content count

    52
  • Joined

  • Last visited

About Doug

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Doug

    Destroying a matter.js rectangle body

    Just to follow up on this, I can confirm that @rgk was right. I changed the code to the following and it all works. this.matter.world.remove(this.wireRect); Thanks again
  2. Doug

    UI Elements on Phaser 3

    I would probably avoid trying to create the login form etc within Phaser. As @snowbillr has hinted at, this would not be all that easy and you're going to need a workaround. Maybe a better approach would be to create an HTML form within a div with a background so that it looks pretty and as if it's a part of the game, but is actually just pure html, css, JS etc and then create or show the Phaser game instance after the login has been processed.
  3. Doug

    Destroying sounds - best practice

    Thanks very much @samme - I am actually using the latest version of Phaser, but I just had another look at my code. It's pretty complicated in there now and it looks like there was one instance where I wasn't destroying the game properly, but just closing the modal. I've amended it now and so far it appears to have done the trick. So I'll do some more testing. Thank you and sorry for wasting your time if it was this.
  4. Doug

    Destroying sounds - best practice

    @rich Sorry to bother you, but I'm still struggling with this one and it's causing me a lot of headaches. What is the best way to completely remove sound from the DOM please? Thanks!
  5. Doug

    onkeyup event (onUp)

    You're most welcome. I assume you've found the documentation here too: https://photonstorm.github.io/phaser3-docs/list_namespace.html Between the labs and the docs you should have everything you need. Enjoy! It's a great framework.
  6. Doug

    Destroying a matter.js rectangle body

    You are a legend, thanks. I can replicate this working in the example page you sent too Will have a go at implementing in my code as soon as I have a chance. Thanks very much! Greatly appreciated.
  7. Doug

    Hi Rich.  @rgk mentioned that you might be able to please add a "patron" badge to my forum profile?  Thanks very much!

  8. Doug

    Destroying a matter.js rectangle body

    Thanks very much. However, the objects still accept collisions etc and also still show up in debug mode. Have you had this working successfully? Just out of interest, how did you get the "Phazer patron" badge to display (I am a patron, but it's not showing for me)?
  9. Doug

    onkeyup event (onUp)

    Hi Josh I think you're looking for this: http://labs.phaser.io/edit.html?src=src\input\keyboard\keydown.js You just replace `keydown` with `keyup`. e.g. this.input.keyboard.on('keyup_A', function (event) { console.log('Hello from the A Key!'); }); I hope this helps and let me know how you get on D
  10. Hi all I'm creating a matter.js rectangle body with the following code: let wireRect = this.matter.add.rectangle(w.x, w.y, this.wireLength, 10, { restitution: 0.9, isSensor: true, angle: angle }); I then later need to remove it from the game. wireRect.destroy(); returns an error "wireRect.destroy is not a function". I have another game in which I am using this.matter.add.image(XXX) and the .destroy() method works fine on those. So I tried: this.matter.world.remove(this.matter.world, wireRect); That doesn't seem to work either. I can see matter.body documentation https://photonstorm.github.io/phaser3-docs/MatterJS.Body.html, but can't see how I would find the correct destroy method for it. Any ideas welcome please! Thanks
  11. Doug

    Rotation of arcade physics body

    No problem at all. I really appreciate that you tried.
  12. Doug

    Rotation of arcade physics body

    Great thank you. Will do.
  13. Doug

    Rotation of arcade physics body

    Thanks, that's really kind of you. Just did the same to check it and it still fails here. It rotates the game object, but not the physics body. let t = this.physics.add.sprite(200, 200, 'sprites', 'windSock_0000'); t.angle = 30;
  14. Doug

    Rotation of arcade physics body

    Thanks. I tried this, but it doesn't work. I tried the following: let t = this.physics.add.sprite(100, 100, 'sprites', 'windSock_0000'); t.body.rotation = 1; ...and let t = this.physics.add.sprite(100, 100, 'sprites', 'windSock_0000'); t.body.angle = 30; Interestingly it doesn't give an error. It just does nothing. I also tried with image and staticImage gameobject types. Do you think this is maybe a bug?
  15. Hi Forgive me if I've missed this, but I can't find it in any of the documentation. Is there a way to specify the the rotation of an arcade physics body? I can rotate the game object image, but that has no effect on the physics body. I would have expected a .setAngle or .setRotation method to be available on Phaser.Physics.Arcade.Body. Seems such a simple one to miss, but I keep needing this and having to use matter, which is just a little more fiddly. Thank you!