Reversi Tutorial - player colours

Game development with Board Game Arena Studio
Post Reply
darrenr
Posts: 2
Joined: 21 May 2019, 10:42

Reversi Tutorial - player colours

Post by darrenr »

I am working my way through the reversi tutorial and have come upon a stumbling block.

After I have generated and placed the first four starting pieces I noticed they all appear as the same colour (white).

I have ensured that the following line is in place:

Code: Select all

$default_colors = array("ffffff", "000000");
When i log out the colours in the addTokenOnBoard function from this.gamedatas.players[player].color I recieve the following two values (008000 and FF0000) (green and red). therefore this does not match up with the classes created in the .css file and the correct portion of the image is never shown.

Has anyone else come across this, or have any suggestions for what is going wrong.

Cheers,
Darren
User avatar
apollo1001
Posts: 191
Joined: 21 July 2015, 10:41

Re: Reversi Tutorial - player colours

Post by apollo1001 »

HI Darren

It sounds like you need to tweak the gameinfos.inc.php file as the line below would correlate with the colours you are seeing:

Code: Select all

'player_colors' => array( "ff0000", "008000", "0000ff", "ffa500", "773300" ),
Cheers
Adam
darrenr
Posts: 2
Joined: 21 May 2019, 10:42

Re: Reversi Tutorial - player colours

Post by darrenr »

Thanks Adam,

That has fixed it :-).

The learning continues...
User avatar
Hornir91
Posts: 38
Joined: 15 October 2018, 06:39

Re: Reversi Tutorial - player colours

Post by Hornir91 »

Hi and thanks, apollo :).

Your tip also fixed my bug with reversi game not taking player colors from array. I had to define it in gameinfos :).
Post Reply

Return to “Developers”