Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update(time, delta) {
- this.player.update();
- // Find the player's room using another helper method from the dungeon that converts from
- // dungeon XY (in grid units) to the corresponding room instance
- const playerTileX = this.groundLayer.worldToTileX(this.player.sprite.x);
- const playerTileY = this.groundLayer.worldToTileY(this.player.sprite.y);
- const playerRoom = this.dungeon.getRoomAt(playerTileX, playerTileY);
- this.tilemapVisibility.setActiveRoom(playerRoom);
- }
Add Comment
Please, Sign In to add comment