natanael zalazar

Members
  • Content count

    2
  • Joined

  • Last visited

  1. Best way to set a collision

    I have problems with my collisions.... if I do not move my character with body.velocity my collisions do not respond. But if I move my character with body.velocity I can not make the walking animation work
  2. Help ! collision with layers

    Hello, i have problems with my layers ... This is my code Mi player has this.body.collideWorldBounds = true; this.game.physics.arcade.enable(this); Create var self = this; self.game.physics.startSystem(Phaser.Physics.ARCADE); self.map = self.game.add.tilemap('map'); self.map.addTilesetImage('tileset'); self.map.addTilesetImage('1556'); self.map.addTilesetImage('1557'); self.map.addTilesetImage('1558'); self.map.addTilesetImage('1559'); self.map.addTilesetImage('12021'); self.map.addTilesetImage('8076'); self.map.addTilesetImage('15118'); self.map.addTilesetImage('15229'); self.map.addTilesetImage('5001'); self.maplayer1 = self.map.createLayer('Tile Layer 1'); self.maplayer2 = self.map.createLayer('Tile Layer 2'); self.maplayer3 = self.map.createLayer('Tile Layer 3'); self.maplayer4 = self.map.createLayer('Tile Layer 4'); self.map.setCollisionBetween(1, 10000, true, self.maplayer2); self.map.setCollisionBetween(1, 10000, true, self.maplayer3); self.map.setCollisionBetween(1, 10000, true, self.maplayer4); self.maplayer1.inputEnabled = true; self.maplayer1.resizeWorld(); self.maplayer2.resizeWorld(); self.maplayer3.resizeWorld(); self.maplayer3.resizeWorld(); const player = new Player({ game: self.game, x: Math.floor((Math.random() * 300) + 1), y: Math.floor((Math.random() * 500) + 1), body: 'human_naked', nickname: 'nat' + Math.floor((Math.random() * 1000) + 1), head: 'elf_head_2', }); self.players.push(player); And my update is var self = this; self.game.physics.arcade.collide(self.maplayer2, self.players[0]); self.game.physics.arcade.collide(self.maplayer3, self.players[0]); self.game.physics.arcade.collide(self.maplayer4, self.players[0]);