I am creating a card game and need some help with Timers.
I am planning on using a Timer to make it look like a card is being taken from the deck and added to a player’s hand. At the start each player draws 5 cards. Can I use one Timer for all drawing cards or should I have one Timer for the first hand and a separate one to each any subsequent draws?
I tried that except the timer for some reason doesn’t activate until player 2’s card are being dealt.
In the Method that calls the Timer to draw 5 card for each player:
intPlayer = intWhoGoesFirst
intDrawNumber = 5
tmrDraw.Mode = 2
But this block of code doesn’t get activated and is completely skipped. Is there a way to pause after the Timer is activated and wait until the timer is turned off before executing the next block of code.
What are you trying to accomplish by calling your timer 5 times in a row with no intervening code?
Don’t set the timer.mode until some other task has been completed.
I have to draw 5 cards for each player. That’s why I asked if I should one timer for the initial 10 card draw and a separate timer for when only one card is drawn.
All the code does in the timer is add one card to the players hand. It’s not actually animated going from the deck to the hand. It just calls the DrawCard method which adds the card to the canvas and then calls the Invalidate(False) method to make the card appear.