• Content count

  • Joined

  • Last visited

  1. Sound muteOnPause problem

    Wow, I just posted a similar thread before seeing this one existed. I almost feel bad. By any chance, does it mute when the game window is unfocused or only when it's triggered ingame?
  2. Title. After I set game.sound.muteOnPause to false, it doesn't mute anymore when the game is unfocused, as expected, but when I manually set game.paused to true via a in-game event, the music still mutes, and even dispatches onMute signal. Is this a bug or I messed up? EDIT: Oh, and I'm using 2.9.1.
  3. Sound element duration is 0

    This is a very old thread, but since it popped up on search (I'm having the same problem as OP but I'm pretty sure my sound is decoded <EDIT: That was solved as well >) I want to add that Sound.onDecoded sends a signal that you can use when you want to wait for a sound to be decoded. Not sure if that was available on the time this thread was made, but for anyone searching, this is a thing.
  4. Please take a look at the two following pieces of code: // Form 1 paddle.events.onDragStart.addOnce(ball.setMovement, ball); // Form 2 paddle.events.onDragStart.addOnce(function() { this.setMovement(); }, ball); Technically these two should be the same. But, for some reason, the first variant isn't quite working according to the plan. In fact, ball is being sent as an argument to .setMovement() instead of being the context, as the docs make me think it should be. The second form works as expected, ball being treated as this. Is this a bug, an example of badly explained documentation or I'm missing something obvious?
  5. Database?

    You don't need to know databases to make games. You might want that if you're doing an online thing, though. I can't answer about the ads, but many games and some portals use ingame ads, so it's possible. Ad-supported games are one way to monetize your software, albeit licensing to portals seem to be the most effective in the short term.
  6. TypeError: this.game.add is not a function

    game.add is indeed not a function. It's a reference to GameObjectFactory, which itself has methods like .sprite(), .group() and, as gauravD mentioned, .existing(), which is great when you have to add a generic GameObject.
  7. Tween duration precision?

    It's likely. From my testing (as I said, the duration, or at least the looping, seems to be incremental), it appears that the tween loops starting with a frame update. I ended up using the Timer instead, that did the trick.
  8. Is there a way to make the game detect you're moving a pointer in a circular fashion? My idea would be to calculate velocity of a projection on a line perpendicular to the supposed centerpoint of the circle, but that sounds it could get a little inaccurate.
  9. Tween duration precision?

    I'm trying to sync a looping tween to a beat, by calculating the tween duration (therefore, the interval) from the BPM. But it's always off-sync! I investigated a bit by subtracting small values to see if I reach some kind of "fake sync", but it turns out the tween seems to be incremental (maybe with the frame updates?), and that won't do. Should I try using the Timer instead or there's a better way?
  10. Can't collide sprite and tilemap

    Well the Discord server saved my butt turns out there was something you did there that I forgot to do. Namely, put the .collide() on the update function. Problem solved, and I have to seriously write that up somewhere so I never ever forget that again. Thanks for the assistence though!
  11. Can't collide sprite and tilemap

    How so? But nevertheless, I define my player after the collision layer, which is exactly what you did. My game currently has only that layer (and an object layer, that isn't created because it's an object layer and just stores data)
  12. Drawing the UI with the DOM

    From what I understand you want a DOM UI that updates when something changes ingame, correct? Maybe you don't need a framework, but something like RxJS?
  13. Can't collide sprite and tilemap

    Looking at your code, I'm still not seeing any reason for mine to fail!
  14. Can't collide sprite and tilemap

    Well, the foreground is the collision layer. I forgot to change the names though, gonna fix that real quick
  15. Jet again, phaser offline

    There's NWjs as well. It does about the same thing Electron does.