Jump to content


  • Content Count

  • Joined

  • Last visited

About jd.joshuadavison

  • Rank

Recent Profile Visitors

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

  1. I'm using the animated tiles plugin from nkholski with the key 'animatedTiles' (how did I come up with that? It's genius). At a certain point I am destroying the game with `game.destroy(true)`. Unfortunately, when creating a new game I'm getting a warning "Scene Plugin key in use: animatedTiles" that then leads to an error "Uncaught TypeError: Cannot read property 'init' of undefined". I've checked the scene and sure enough, the plugin has not been added to it. I tried destroying the game cache before destroying the game, but that just gave me an error too. Josh
  2. Hi Samme, Thanks for taking the time to respond - and I'm sorry for my slow reply. I've been taking a break from my game for the last couple of weeks, but I'm back on it now. Do you think the tiles being culled whilst they are still within the cameras viewport is a bug then? Also, my layer is definitely not receiving the x and y values from from my JSON. But I can set them myself in the code with no problems. Is this also a bug? Should I report them on GitHub? I'm going to move onto working out a workaround now. I'm thinking that I can probably take this layer out of t
  3. Okay so, Horizontal Offset is definitely what I want and is definitely not supported - I will raise a feature request on GitHub shortly. In the meantime I've had no luck with a work around. It seems that in phaser 2, tilemap layers had a property called `cameraOffsetX`, which might have done the job, although, equally, that might have done exactly the same thing as phaser 3's `x` property. But I can't find anything like that in Phaser 3. Any suggestions?
  4. I'm using a callback function on the overlap method, but it's firing at the wrong time. After a bit of calculation/trial and error I worked out that it is firing where the sprite would have been if the scrollFactor of the sprite was the default setting of 1. I assume this is a bug? See demo on jsFiddle. Update: it also ignores the objects origin and assumes its origin is the default 0.5. I've updated the demo. Update 2: I'm now fairly certain this is not expected behaviour, so I've raised an issue on GitHub. Thanks, Josh
  5. Hello, I've built a tilemap using Tiled. The only thing is, I want to offset the tilemap (or preferably, individual tilemap layers) dynamically in the game (i.e. by a variable/calculated number of pixels). Tiled does have a 'Horizontal Offset' property for the layer. Obviously that would be a fixed value, but I thought it would map to a property of the tilemap layer object which I would then be able to dynamically modify, but as far as I can tell Phaser doesn't do anything with the 'Horizontal Offset' property. So I tried setting the tilemap layer's x position. This did offset t
  6. Thanks Doug! I really wish I'd found the labs earlier! That's exactly what I'm looking for. In fact, Phasers keydown event works differently from the regular javascript onkeydown. Javascript's onkeydown will keep firing repeatedly if you hold the key down, Phasers keydown only fires once, so I think I prefer keydown to keyup! Here's my new event listener in the create function. this.input.keyboard.on('keydown_UP', function (event) { if (player.body.onFloor()) { player.body.setVelocityY(-400); player.anims.play('idle', true); jumpCount = 1; jump
  7. Hi, Broad question It's my second day learning Phaser. I've dived straight into Phaser 3, but its proving challenging since the docs are only available in the GitHub repo. It looks like there was an event handler in Phaser 2 called 'onUp' which would only fire once when a key was released instead of continuously firing for as long as the key is held down like 'isDown' does. This doesn't seem to exist in Phaser 3 - what is the correct way of doing this in Phaser 3? In this particular instance I'm trying to do this on a cursor key, but it would be useful to know how to do it on an
  • Create New...