rybaqs

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Thx for reply, I will make such tiles collide with player then...
  2. So, i've got topdown game i'm working on, and I use tiled to make JSON tilemap which then I load in phaser 3. Everything works great, I've got collision (which I set between range of tiles), but here's the problem: some of tiles have round edges or are should be only partially blocking player from moving, yet in phaser I set collision on whole tile (which has one number). Is there a way (and as I recall from past there should be, couse I already toyed with phaser 2 some years ago) to set collision per tile? Here's what I would love to fix (character standing on water, couse tile he's on has no collsion, couse it's partially a DIRT, and partially a WATER): And maybe I could somehow use this information (that as I presume is already in JSON file, made by TILED):
  3. I know that this question is really basic one, but I need help with it. Let's assume, we've got this simple Scene: class OverworldScene extends Phaser.Scene { constructor(config) { super({ key: 'OverworldScene' }); } preload() {...} create() { const player = this.physics.add.sprite(100, 100, 'tank', 'tank1'); } update() { this.cameras.main.scrollX = player.x; this.cameras.main.scrollY = player.y; } } export default OverworldScene; This code is not proper, becouse it says player is not available in update() function. How to fix this? Should I use this.player? Btw, here's really cool solution, but it's in ES5 https://labs.phaser.io/edit.html?src=src\games\topdownShooter\topdown_averageFocus.js var config = { type: Phaser.WEBGL, width: 800, height: 600, physics: { default: 'arcade', arcade: { gravity: { y: 0 }, debug: true } }, scene: { preload: preload, create: create, update: update, extend: { player: null, reticle: null, moveKeys: null, bullets: null, lastFired: 0, time: 0, } } }; this "extend" bit - I would love to use it in ES6 (I've got array of Scenes in this place).