I am making a 3 in a row game. And I was wondering about moving the pieces on the board.
I have a game master actor that tells the pieces where to move. But should I have a Move actor in the game master blueprint. Or should I have a custom event in the piece that I want to move. Wich makes the piece move to the desired location. Both of them work but which of them should I use.
(Sorry for the bad termiology)
For a game without that much complexity, it doesn’t really matter. I would put everything in the GameMode class though.
Make the pieces as a parent class, and all individual characteristics as children
In the parent, make sure it could receive event to move, and to where
from ‘your master BP’, you should then call ‘the move’ to the individual piece.
This would IMO be the ‘right’ way to do it, because:
Your ‘Master bp’ - where your game logic is - will be much, much cleaner: DO the math, then call move on the piece.
You can then change ALL move efx/animations by ONLY changing the parent.
You can debug things in parts: Does move work? If yes, THEN Does game logic work? (and trust me, you want that
If you want to have multiplayer along the line you should use the Gamemode class for rules logic and calling to pieces to move
PlayerController > Asks Gamemode to move piece > Gamemode checks if legal move > if so tells piece to move
the act of actually moving is in the playpiece to keep it clean as Firtsl said