Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add enemies #1

Open
pdewouters opened this issue Oct 24, 2016 · 1 comment
Open

How to add enemies #1

pdewouters opened this issue Oct 24, 2016 · 1 comment

Comments

@pdewouters
Copy link

First, thanks for making this package, great work.

I'm using it to create a game such as https://codepen.io/FreeCodeCamp/full/PNJRyd/

How would I go about adding enemies and items to pick up?
thanks

@domasx2
Copy link
Owner

domasx2 commented Oct 24, 2016

Hey,

Well the idea is:
Iterate rooms, find unoccupied tiles, spawn objects there. If object is solid (impassable), make sure that a route still exists between each pair of exits.

Here's a Populator class that might be helpful from one of my doodles: https://github.com/domasx2/scifiroguelike/blob/master/javascript/engine/mapgen/populator.js

It's using a slightly older version of dungeon generator though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants