1 min
We needed to thet cards being draw form the deck by the player and then the effects of those cards being used when the player clicked on the card. This needed to be for every player on their turn. AT first when player clicked on eth tile, their icon moved to hat tile and the ‘current_player_turn’ would increment and that would get sent to the next player. If that value matched your client id then it would trigger a value to be true and the player could then move. This changed for the use of cards so I added in player input enum with 4 values.
enum class PlayerInput : int
{
NONE = 0, // not doing anything
MOVE_TILE = 1, // move tiles
USE_CARD = 2, // use a card
TILE_SEL = 3, // select a tile
};
Instead of passing the curent player turn, a varaible of this enum was sent to the client id that matched the current player turn. When the user receives this data a simialr variable is sent from NONE to whatever is streammed out of the packet, The user can then perfrom certain actions depending on value the variable is set to.
When the player input equals ‘USE_CARD’ the player can click on the card drawn for the deck for it’s effect to take place. If the card drawn is a deforestation, mass deforestation or recovery then it will allow the player to click the card, and then click on a tile to effect. If the drawn card is a poacher then it automatically does the effect of the card. If it is a deforest card then the tiles change from green to orange to show death and deforesation. The image below show the player clicking and the board changing depending on whta card it is.
Subscribe to this blog via RSS.
Low level programming dev diary 28
Text based adventure dev diary 6
Level design developer diary 3
Game engine programming dev diary 14
Audio-visual production dev diary 7
Audio-Visual Production: Particle System Mesh Spawning Issues
Posted on 20 Feb 2020Low level programming dev diary (28) Text based adventure dev diary (6) Level design developer diary (3) Post mortem (4) Ex-machina dev diary (11) Game engine programming dev diary (14) Network game dev diary (11) Audio-visual production dev diary (7)