rich

Administrators
  • Content Count

    6,342
  • Joined

  • Last visited

  • Days Won

    294

Everything posted by rich

  1. rich

    Bullets not shooting properly

    Like this (click Edit to see the code) http://labs.phaser.io/view.html?src=src/pools/bullets.js&v=dev
  2. rich

    Bullets not shooting properly

    When you fire a bullet you need to record the time. You can get this as the first argument to the update function (i.e. make it function update (time)) You then don't allow them to fire again until X ms have passed. What X is, is up to you. Try around 200 for a slow-fire, 50 for a faster one, etc.
  3. rich

    Getting Started Issues

    Sounds like Phaser isn't loading in the html. What script tag do you have in there?
  4. rich

    How do we bounce shapes

    setVelocity is a method only available to Arcade Physics objects, like ArcadeImage and ArcadeSprite. To enable a Shape you need to do it like this: var r1 = this.add.rectangle(200, 150, 148, 148, 0x6666ff); var r2 = this.add.rectangle(400, 150, 148, 148, 0x9966ff).setStrokeStyle(4, 0xefc53f); this.physics.add.existing(r1); this.physics.add.existing(r2); r1.body.velocity.x = 100; r1.body.velocity.y = 100; r1.body.bounce.x = 1; r1.body.bounce.y = 1; r1.body.collideWorldBounds = true; r2.body.velocity.x = -100; r2.body.velocity.y = 100; r2.body.bounce.x = 1; r2.body.bounce.y = 1; r2.body.collideWorldBounds = true;
  5. rich

    Preventing key default events stops key repeats

    Keys still repeat, even if blocked from the browser - how are you checking for key presses?
  6. The free version will work fine, but honestly, if you're serious about game dev, even a little bit, it's a fantastic investment.
  7. It's created by Texture Packer.
  8. rich

    Phaser 3 texture getPixels (plural)

    Use a CanvasTexture. It has a pixels property, as well as an arrayBuffer and all the other things BitmapData had.
  9. rich

    Minako Vs Zombies - New Phaser Game

    Well that looks great!
  10. rich

    Event listeners causing Memory Leaks

    https://github.com/photonstorm/phaser/commit/0a166f944f23f4ad05100106d2323eb152f2bbde They absolutely don't add themselves to the shutdown event any longer. This is a Scene in 3.13 with 91 Images on the display list: and here is the same Scene in 3.12: The shutdown event has 91 less entries in it in 3.13, exactly as it should do.
  11. rich

    No Phaser any more!!!

    There is no gap. Only those willing to learn will get anywhere.
  12. rich

    Enabling SSL via localhost

    @Keisha yeah the FBIG site has details on how to generate the keys as part of their quick start guide, have a read of it, do it on a Mac, then just copy the keys to your PC. @vamos The Facebook Instant Games iframe pulls in from localhost, but only via SSL. No SSL, nothing works, and you cannot test FBIG games 'locally' any other way.
  13. rich

    WebGL: too many errors

    With what code? As none of the examples exhibit it that I've seen.
  14. rich

    No Phaser any more!!!

    Actually, it's up to you to learn. I gave you links to more resources than you could probably even manage to read or watch in a year. What you do with those is entirely up to you. To say they are all 'starting points' proves you haven't even looked at them I'm afraid. Learning takes effort. You get out what you put in. Put nothing in, get nothing out. The fact there are literally thousands of really fantastic games made with Phaser demonstrates the barrier to entry isn't that high, or we wouldn't see anything made with it. There is no way all of those developers are all 'advanced' from the beginning. None of them read some super-secret hidden book you've yet to find. Most learn by experimenting. Going through tutorials, docs, and examples and actually sitting down and working. This isn't a conspiracy. Anyone is capable of doing it if they have the willpower.
  15. rich

    BitmapData drawcalls

    The problem is, their atlas elements (the puzzle pieces) are being generated dynamically at run-time, so they cannot use Texture Packer. Even so, it's possible to create atlas / sprite sheet data dynamically. It would be easier to start with a sprite sheet, as all the frames are the same size. Essentially the flow would be this: 1) Create all of your puzzle pieces in their own BitmapData objects 2) Draw each piece into a single BitmapData / Canvas, so that they are equally spaced out. I.e. assume each piece fits into 200x200 squares, then draw them into the single BMD spaced out like that. 3) Create the Sprite Sheet data for your 'single' BitmapData. 4) Use it in your game, destroying the previous 'piece' BitmapData's to save memory. There is an example that shows exactly how to do this already: http://phaser.io/examples/v2/animation/dynamic-animation
  16. rich

    Does set position take any game ticks?

    Depends how you're handling the button callback. But if it's completely within Phaser and not something outside of it, then the position will be set immediately and visible during the next render pass.
  17. rich

    Enabling SSL via localhost

    Yeah, it's a royal pain in the ass on Windows to get this set-up. Do you have access to a Mac or the ability to ssh into a Unix based VPS? If so, you can generate the keys on there and then transfer them to your PC. This is what I did anyway, it's SO much easier than messing around trying to install OpenSSL on Windows.
  18. rich

    Help debugging through Physics with Phaser 3

    The debug.cameraInfo line of code is from Phaser 2. It doesn’t do anything in v3 (I’m surprised it didn’t throw an error to be honest!)
  19. rich

    No Phaser any more!!!

    This is so very, very wrong. There are some amazing Phaser 2 resources. This book is excellent, starts right from the beginning and goes into lots of depth. The Zenva Phaser 3 course is massive. 15 hours of really top-quality content, covering all aspects of game dev from ES6 and on. They have a really successful Phaser 2 version as well (which is a lot cheaper). There's even a free 4 course taster you can try for nothing. There's a free 420 page Phaser 2 book, Game Development for Human Beings, which again is a superb read. Comprehensive, lots of structure covered, lots of details. There are loads of videos for v2. YouTube is full of playlists like this 8-part one on creating a platform game in v2. Then there are the one-shot tutorials. The Phaser site alone lists over 710 of them covering everything from single effects like progress bars to massively in-depth coverage of tilemap physics. I challenge you to find this many resources for Pixi. Actually, I challenge you to find this many resources for any other open source game framework. It's all out there. To say otherwise is, I'm afraid, ignorance.
  20. rich

    Open url in a new new tab Safari

    Like this: http://labs.phaser.io/view.html?src=src\input\dom events\add up callback.js It needs specific handling so that the callback is executed in the event handler. Look at the docs for this.input.addUpCallback because they're extensive and explain how to use it and what to look out for.
  21. rich

    phaser 3.12.0

    Sounds like a server config issue to me. Just use absolute paths, rather than relative ones like you've got. Maybe some code to check the URL of the host and swap between them.
  22. This is being looked at for the 3.13 release this week btw.
  23. rich

    phaser 3.12.0

    My guess is the font xml file isn't loaded. Check your network panel in your browser dev tools - any 404 errors or similar there? I'll bet the font texture worked, but the xml didn't.