Thousand Card Game: Trick Position Animation

in #utopian-io7 years ago (edited)

cards held by a man
Image source: pixabay.com

What is this project about?

This contribution is made to gornanization/1k-table. If you would like to find more info - I strongly recommend reading this post first.

PR:

https://github.com/gornanization/1k-table/pull/5

Details:

As you can see above, I defined new positions. It includes:

  • DECK position (It's basically place, where three trick cards comes from, the very top of the screen),
  • TRICK_FIRST, TRICK_SECOND, TRICK_THIRD (Centre of the screen, three card position reserved for trick).

How about code standing behind the animation?

image.png

It includes few actions (:67 - :70):

  1. moveCardsToStock
  2. showStockCards
  3. delay
  4. moveStockCardsToWinner

It starts with moveCardsToStock. It simply moves stock cards from DECK into STOCK position. When we have all three cards already on the centre of the table, we can show this card to the players, one by one, with some delay in between (see showStockCards). After that, we can move this card to the player. In this particular case I assumed that the first player (linked with PLAYER_FIRST position) won the biding phase.

Within the contribution I also specified three additional positions for cards being won by the players. Those positions are: WON_PLAYER_FIRST, WON_PLAYER_SECOND, WON_PLAYER_THIRD.

image.png

Above you can see the case, when the second player won a trick. Won cards are being moved from trick position into specific area near the player, as it will no longer be used within the current battle anymore.

More details? See the pull request!

Bye Bye, Winners!

Recent articles:
Thousand Card Game: Trick Animation
Thousand Card Game: State Management
Thousand Card Game: Card & Table Components



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Nice Post
Happy New Year

Thank you for the contribution. It has been approved.

Nice to see another update from your end! You're one of the few authors who consistently provides a crisp overview of their work that makes for easy viewing to a casual reader. Keep it up!

You can contact us on Discord.
[utopian-moderator]

Hey @adasq I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 68383.66
ETH 2646.07
USDT 1.00
SBD 2.72