Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. update(time, delta) {
  2. this.player.update();
  3.  
  4. // Find the player's room using another helper method from the dungeon that converts from
  5. // dungeon XY (in grid units) to the corresponding room instance
  6. const playerTileX = this.groundLayer.worldToTileX(this.player.sprite.x);
  7. const playerTileY = this.groundLayer.worldToTileY(this.player.sprite.y);
  8. const playerRoom = this.dungeon.getRoomAt(playerTileX, playerTileY);
  9.  
  10. this.tilemapVisibility.setActiveRoom(playerRoom);
  11. }
Add Comment
Please, Sign In to add comment