I'm making a Clue(do) board game in Java to improve my programming skills. I've done a lot of work so far, but now I'm stuck at finding an algorithm to make sure if a player can make a certain move.
Quick draw of how it's organised:
- Superclass GameTile
- Subclasses for each roomtype (RoomTile, DefaultTile, StartTile & OutsideTile)
The goal is to show the players all the possible moves a player can do when he throws the dice. I have found a way to look "around" the player to see which tiles it can reach, but the problem to see if a player can enter the room through a door (or if the player can reach that default tile), remains.
All squares you can see are presenting one of the classes previously mentioned:
- Black: outside
- white/pink: default
- lightblue: rooms (doors are inside the roomclass flagged with boolean, no visual representation yet)
- colored: start tiles
Anyone have an idea to solve this?