archerbird / Pacman

An OOP implementation of Pacman in Excel
10 stars 4 forks source link

Game Piece Interactions #4

Open archerbird opened 4 years ago

archerbird commented 4 years ago

We need to implement a way for game pieces to interact with pacman when they share the same tile as their IGamePiece.CurrentTile

Off the top of my head:

retailcoder commented 4 years ago

I think this all needs to be handled at the controller level; if map tiles are storing their state (e.g. HasPellet), then the map can raise an event when something happens that the controller should know about and pull whatever strings need to be pulled to e.g. toggle ghost modes.

archerbird commented 4 years ago

I think this all needs to be handled at the controller level; if map tiles are storing their state (e.g. HasPellet), then the map can raise an event when something happens that the controller should know about and pull whatever strings need to be pulled to e.g. toggle ghost modes.

This comment makes me worry that I've put way too much game logic in the models :-/

archerbird commented 4 years ago

I guess the way I'm thinking about this is kind of like having a Controller class for each of the models that wraps the model and encapsulates logic for how it moves and interacts. Though, currently I have all this controller logic and state logic all in one model class (for each model type)