Skip to content

Commit

Permalink
Update dungoneer to forked version, remove manual typings
Browse files Browse the repository at this point in the history
  • Loading branch information
mipearson committed Dec 28, 2019
1 parent 70dbc60 commit b16fdad
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 32 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ Otherwise, go nuts.

## TODO

* proper typings for mrpas
* proper typings for dungeon-factory
* extrude tilesets to avoid webgl issues
* support window resize

## Credits

* Uses [mrpas](https://www.npmjs.com/package/mrpas) to determine the field of view
* Uses [dungeon-factory](https://www.npmjs.com/package/dungeon-factory) to generate the dungeon
* Uses [dungeoneer](https://www.npmjs.com/package/dungeoneer) to generate the dungeon
* `Rogue*.png` files are from the [Rogue Dungeon Tileset 16x16](https://fongoose.itch.io/rogue-dungeon-tileset-16x16) by [fongoose](https://twitter.com/fongoosemike)
* "CasualEncounter" font from Anna Anthropy's [World of Fonts](https://w.itch.io/world-of-fonts)
13 changes: 9 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "Michael Pearson & Others",
"license": "MIT",
"dependencies": {
"dungeon-factory": "^1.0.6",
"dungeoneer": "github:mipearson/dungeoneer#mp-fix-ts-bindings",
"mrpas": "^2.0.0",
"parcel": "^1.12.4",
"phaser": "^3.21.0",
Expand Down
27 changes: 4 additions & 23 deletions src/entities/Map.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
import DungeonFactory from "dungeon-factory";

import Dungeoneer from "dungeoneer";
import Tile, { TileType } from "./Tile";
import Slime from "./Slime";
import Graphics from "../assets/Graphics";
import DungeonScene from "../scenes/DungeonScene";

interface DungeonFactoryRoom {
height: number;
width: number;
x: number;
y: number;
getBoundingBox: () => {
top: number;
left: number;
right: number;
bottom: number;
};
}

interface DungeonFactoryOutput {
tiles: { type: string }[][];
rooms: DungeonFactoryRoom[];
}

export default class Map {
public readonly tiles: Tile[][];
public readonly width: number;
Expand All @@ -36,13 +17,13 @@ export default class Map {

public readonly slimes: Slime[];

public readonly rooms: DungeonFactoryRoom[];
public readonly rooms: Dungeoneer.Room[];

constructor(width: number, height: number, scene: DungeonScene) {
const dungeon = DungeonFactory.generate({
const dungeon = Dungeoneer.build({
width: width,
height: height
}) as DungeonFactoryOutput;
});
this.rooms = dungeon.rooms;
console.log(this.rooms);

Expand Down
1 change: 0 additions & 1 deletion typings/dungeon-factory.d.ts

This file was deleted.

0 comments on commit b16fdad

Please sign in to comment.