I’m using -2 for doors, -3 for prohibited corners, and I expect to keep adding special values over time. I use magic numbers a lot, and I need to get better about using named constants. Return face * (TILES_PER_SIDE * TILES_PER_SIDE) + x * TILES_PER_SIDE + y įace(id) else if (E = OWNER_WALL & W = OWNER_WALL With 0-5 for the face id, I have a way to have a global tile id for every tile on the cube. I wrote some code to convert back and forth, and then used 0-5 for all the code except the neighbors function. But the row/column arrangement seemed like it’d be harder to work with, so I switched back. I had originally used 0-5 to mark the cube faces, but then last week I realized it’d be easier to use a row/column arrangement to make the calculations simpler. I started this project by copying the code from last week, and then removing the parts I wouldn’t need (animations mostly). This page describes what I tried, what worked, and what didn’t. I’ve never made a dungeon generator before, but I knew everything would be complicated by working on this cube/sphere surface, so I decided to keep the dungeon generation part simple.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |