Question about Stock and cards

Game development with Board Game Arena Studio
Post Reply
User avatar
VanHlebar
Posts: 68
Joined: 24 September 2019, 02:30

Question about Stock and cards

Post by VanHlebar »

In El Grande players have a deck of cards that are used for bidding at the start of each turn. I am using the Stock JS item to handle the images and of course Cards on the backend.

After my first play through today with my gaming group they had a suggestion for the layout which I had not thought of and I fixed it tonight. In doing so though, I have run into a slight problem that I am sure can be fixed but I am struggling with how to do so.

The cards are sorted from 1 - 13 in order by default. When a player uses a card, it gets removed from their hand and placed into the discard pile. I had been putting them into a different DIV below the currnent hand, however what they would prefer to see is just the cards flipped over in the main "hand" DIV. I have figured out how to remove the card and then put a card "back' if you will at the end of the Stock and display a tool tip that shows the card face. Is there anyway to just flip the card over in place?

Here is a screen shot of what I am talking about.

https://photos.app.goo.gl/h4zvMDW8xHzqkUT29


What I would like to have happen in this image is when the Yellow player used the power card 7 that it would have just "flipped" over and showed the card back between the 6 and 8 cards.

Any help is greatly appreciated!

Thansk!
User avatar
Loreroth
Posts: 18
Joined: 05 August 2014, 07:28

Re: Question about Stock and cards

Post by Loreroth »

Have a look at the sharedcode project by Victoria_La it has a very nice card filp animation that looks like is just done in css.
(if you have trouble finding it the recent purge may have unlisted it. source code is also here: https://github.com/elaskavaia/bga-sharedcode)

You could also just change the image without an animation.
User avatar
VanHlebar
Posts: 68
Joined: 24 September 2019, 02:30

Re: Question about Stock and cards

Post by VanHlebar »

Thanks for the direction. I was looking at Sharecode and struggled with it. I would be fine without the animation if I could just figure out how to replace the image and keep the location inside my Stock collection.
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: Question about Stock and cards

Post by tchobello »

hi

perhaps you can use a addClass to blur the card...
with a something like background-color: rgba( 255,200,200,0.3 );
User avatar
A-dam
Posts: 107
Joined: 28 September 2013, 18:15

Re: Question about Stock and cards

Post by A-dam »

Hi,

take a look to King's Guild. I use card flipping a lot, just with changing css class.

I dont use Stock because I needed more flexibility but I dont see why it shoud not work with stock..

Adam
User avatar
VanHlebar
Posts: 68
Joined: 24 September 2019, 02:30

Re: Question about Stock and cards

Post by VanHlebar »

Thanks Adam, I will take a look.

Great game btw! I love it....just wish I was better. :)
User avatar
VanHlebar
Posts: 68
Joined: 24 September 2019, 02:30

Re: Question about Stock and cards

Post by VanHlebar »

So in the end I decided to scrap the Stock component for the power cards entirely and just rolled with CSS. While it meant ripping out all the graphic routines that had been setup, it ended giving me the flexibility that I needed. I really appreciate everyone's help and pointers!
User avatar
Volker78
Posts: 66
Joined: 29 April 2020, 21:37

Re: Question about Stock and cards

Post by Volker78 »

You are implementing el grande for bga? How is your progress? Is it possible to help testing? I also have professional php/html/js/css programming skills and could help with programming. I also know el grande well, and have the german board version at home, so I also could help translating.
User avatar
VanHlebar
Posts: 68
Joined: 24 September 2019, 02:30

Re: Question about Stock and cards

Post by VanHlebar »

Volker78 wrote: 06 May 2020, 21:54 You are implementing el grande for bga? How is your progress? Is it possible to help testing? I also have professional php/html/js/css programming skills and could help with programming. I also know el grande well, and have the german board version at home, so I also could help translating.
I am in VERY early stages of testing. Had one play through with my game group and now working on trackign down the bugs they helped locate. Once I get those done I will definately reach out to you and add you to the list of players for the actual Alpha testing.

At this point all base game is installed and working.... well for the most part. :)
Post Reply

Return to “Developers”