All started a couple of months ago when as a board gamer I felt the necessity to put a "real" dice in the game I was developing, I felt that implementations so far on games lacked the "second of suspense" that a tabletop dice rolling transmits.
So I took some examples from here and there and wrote a codepen thing to make a dice roll in 3D (6 divs rotated and wrapped together )and show the result decided by the server adding a css animation. I also customized and filtered a dice rolling sound .
I wrote the game, and put a lot of care on the cards and dice, my cards are 2 divs that stick to each other, one of them rotated 180` so when I flip them the card shows the right image.
But then after that I thought... I could be nice to see the dice from a side to appreciate better the animation so I tilted a bit the surface that hold the board to give it a sense of depth. And then I saw the dice rolling and thought... wow this looks and feel more like the tabletop game... What if i change my z-index settings of the cards on the deck to be a translatez transform... and The decks and the tiles appeared in 3D.
Ok, I need some controls to move the point of view and the perspective. Then I wrote a small controller for the perspective ... and that is even better!!! now it really looks like the real game!.
Some minor adjustments on the css animations and ad a Zaxis transition effect to my flip card effect (the one that Victoria_La put on the code share project) and WOW! it is moving like the real game.
I learned all by myself reading css documentation and there is no source of how to do 3d animations with Dojo but I offer here the source code to the community of the little tricks I used to make something really simple and cleverly sticking css transforms and animations to make our "web games" feel like "board games".
here the source:
https://github.com/AntonioSoler/bga-takaraisland
Tomorrow you will see all of this in movement.
So I took some examples from here and there and wrote a codepen thing to make a dice roll in 3D (6 divs rotated and wrapped together )and show the result decided by the server adding a css animation. I also customized and filtered a dice rolling sound .
I wrote the game, and put a lot of care on the cards and dice, my cards are 2 divs that stick to each other, one of them rotated 180` so when I flip them the card shows the right image.
But then after that I thought... I could be nice to see the dice from a side to appreciate better the animation so I tilted a bit the surface that hold the board to give it a sense of depth. And then I saw the dice rolling and thought... wow this looks and feel more like the tabletop game... What if i change my z-index settings of the cards on the deck to be a translatez transform... and The decks and the tiles appeared in 3D.
Ok, I need some controls to move the point of view and the perspective. Then I wrote a small controller for the perspective ... and that is even better!!! now it really looks like the real game!.
Some minor adjustments on the css animations and ad a Zaxis transition effect to my flip card effect (the one that Victoria_La put on the code share project) and WOW! it is moving like the real game.
I learned all by myself reading css documentation and there is no source of how to do 3d animations with Dojo but I offer here the source code to the community of the little tricks I used to make something really simple and cleverly sticking css transforms and animations to make our "web games" feel like "board games".
here the source:
https://github.com/AntonioSoler/bga-takaraisland
Tomorrow you will see all of this in movement.