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

Refactor Tile Representation #13

Closed
sunjay opened this issue Oct 21, 2018 · 1 comment
Closed

Refactor Tile Representation #13

sunjay opened this issue Oct 21, 2018 · 1 comment
Labels
refactoring Something needs improvement (doesn't change functionality)

Comments

@sunjay
Copy link
Owner

sunjay commented Oct 21, 2018

The validations module is kind of a code smell. Instead of validating at runtime, we should be forcing the type system to take care of things for us. If Walls can't have objects, then we should change Tile so that they can't have objects. We can do this using an enum that only has tile properties that make sense for each tile.

The TileType representation is also pretty horrendous. Like Room and Door are both technically room tiles. But then so is Wall. Passageway and PassagewayWall are both passage tiles but we don't group them that way. This whole type should not be a flat enum. We should have separate ones for PassageTile and RoomTile.

Related: game map should not store tile size. Should use the tile size of the current level.

Some considerations:

  • When deciding on tile sprites, we will need to consider a wholistic representation of "rooms" so that we can scatter things like torches and generate appropriate floor tiling patterns.
  • There may be walls within rooms, not just around them or around passages
  • Need to know which tiles are part of a given room so we can place objects
  • Objects can never block a doorway or go on a wall
@sunjay
Copy link
Owner Author

sunjay commented Oct 26, 2018

Fixed in #24 and 82f3142

@sunjay sunjay closed this as completed Oct 26, 2018
@sunjay sunjay added the refactoring Something needs improvement (doesn't change functionality) label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Something needs improvement (doesn't change functionality)
Projects
None yet
Development

No branches or pull requests

1 participant