{"id":6503,"date":"2007-03-14T10:41:00","date_gmt":"2007-03-14T10:41:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vbteam\/2007\/03\/14\/coding-a-euchre-game-part-3-timers-matt-gertz\/"},"modified":"2024-07-05T14:49:24","modified_gmt":"2024-07-05T21:49:24","slug":"coding-a-euchre-game-part-3-timers-matt-gertz","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/vbteam\/coding-a-euchre-game-part-3-timers-matt-gertz\/","title":{"rendered":"Coding a Euchre Game, Part 3: Timers (Matt Gertz)"},"content":{"rendered":"<h2><font size=\"5\"><font color=\"#365f91\"><font face=\"Cambria\">Coding a Euchre Game, <span>Part 3: Timers<\/p>\n<p><\/span><\/font><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">In my previous posts regarding the Euchre game creation, I discussed some issues with creating a complex form and maintaining images to be shown on it.<span>&nbsp; <\/span>In this posting, I&rsquo;m going to start covering some of the more esoteric controls.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<h2><span><font size=\"4\"><font color=\"#4f81bd\"><font face=\"Cambria\">Timers and Message Pumps<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Try this:<span>&nbsp; <\/span>go to your Programs menu in Windows and launch the &ldquo;Hearts&rdquo; game.<span>&nbsp; <\/span>Play a few hands of it.<span>&nbsp; <\/span>Go ahead, I&rsquo;ll wait.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><i><span><font size=\"3\"><font face=\"Calibri\">(hum-dee-dum-dee-dum)<\/p>\n<p><\/font><\/font><\/span><\/i><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">You back yet? Notice anything a little odd about that game?<span>&nbsp; <\/span>The action is just a little fast, isn&rsquo;t it?<span>&nbsp; <\/span>In fact it&rsquo;s so fast that you can barely take it in, and it takes you a few seconds just to realize what the other players have done.<span>&nbsp; <\/span>That&rsquo;s just too fast for me, and although I enjoy playing Hearts on my handheld (where it&rsquo;s much better paced), I simply can&rsquo;t play it on my desktop &ndash; it just feels unnatural.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Hearts is fast because the AI players simply connect their actions from one to the other without pauses.<span>&nbsp; <\/span>Real players don&rsquo;t act like that, though.<span>&nbsp; <\/span>To simulate real player hesitation, we&rsquo;re going to use a timer control.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">To start this, we simply drag a Timer control from the toolbox to the EuchreTable form.<span>&nbsp; <\/span>You&rsquo;ll note that the timer control does not actually land on the form, but instead goes to a grey area below the form.<span>&nbsp; <\/span>That&rsquo;s because timers don&rsquo;t actually have real positions; they&rsquo;re never visible, so it makes no sense to put the on the form itself.<span>&nbsp; <\/span>However, you still need to be able to set properties on them,which is why they show up in that grey area.&nbsp; (Controls such as these are essentially identical to the old concept of a &#8220;windowless control.&#8221;)<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">For the timer control, we&rsquo;ll change its name to &ldquo;EuchreTimer&rdquo; and set the Interval to 1500 (measured in milliseconds) as a default &#8212; we can always adjust it later.<span>&nbsp; <\/span>Now, in the constructor for EuchreTable, we&rsquo;ll add the following line of code:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>AddHandler<\/span> EuchreTimer.Tick, <span>AddressOf<\/span> TimerEventProcessor<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">which specifies the handler for the Tick event which will occur every 1.5 seconds. <\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Now, we don&rsquo;t want the timer to be on all the time.<span>&nbsp; <\/span>We just want it to fire when the AI is making a decision.<span>&nbsp; <\/span>So, by default, the timer will be off, and we&rsquo;ll turn it on when needed.<span>&nbsp; <\/span>After it fires once, we&rsquo;ll turn it off again.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> TimerEventProcessor(<span>ByVal<\/span> myObject <span>As<\/span> <span>Object<\/span>, _<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;<\/span><span>ByVal<\/span> myEventArgs <span>As<\/span> EventArgs)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EuchreTimer.Stop()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">When we want to use the timer, we simply turn it on.<span>&nbsp; <\/span>Let&rsquo;s put the call in a method called TimerSleep which anyone can call to start up the timer:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> TableSleep()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EuchreTimer.Start()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/span><\/span><span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">However, now we have a problem.<span>&nbsp; <\/span>The timer doesn&rsquo;t actually block the AI from proceeding &ndash; it just throws out a &ldquo;tick&rdquo; which will be handled.<span>&nbsp; <\/span>To actually block the AI from proceeding, we&rsquo;re going to need to wait for the tick.<span>&nbsp; <\/span>Let&rsquo;s create a member variable call GoAhead and add a check for that to the two routines we&rsquo;ve defined:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> TimerEventProcessor(<span>ByVal<\/span> myObject <span>As<\/span> <span>Object<\/span>, _<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;<\/span><span>ByVal<\/span> myEventArgs <span>As<\/span> EventArgs)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EuchreTimer.Stop()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>GoAhead = <span>True<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> TableSleep()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>GoAhead = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EuchreTimer.Start()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>While<\/span> GoAhead = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>While<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/span><\/span><span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\"><span>&nbsp;<\/span>Cool, now anyone calling TableSleep will block until the value of GoAhead changes when the timer event is processed, right?<span>&nbsp; <\/span>Well, no.<span>&nbsp; <\/span>The timer uses the UI message pump, and with the code as it currently is, the Timer message won&rsquo;t be processed.<span>&nbsp; <\/span>There are other messages that we&rsquo;d want to have handled as well, such as those involving painting the application.<span>&nbsp; <\/span>So, we&rsquo;re going to need to pump messages.<span>&nbsp; <\/span>This is extremely easy to do by using the Application.DoEvents() method:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> TableSleep()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>StopPumpingMessagesDuringPause = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EuchreTimer.Start()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>While<\/span> GoAhead = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;<\/span>Application.DoEvents()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>While<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/span><\/span><span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Now, what if the user exited the game (or start a new one) while the timer was functioning?<span>&nbsp; <\/span>We&rsquo;d like to turn off the timer immediately, rather than have them wait to exit.<span>&nbsp; <\/span>We do this by handling the &ldquo;Closed&rdquo; event (or the New Game message, as applicable).<span>&nbsp; <\/span>First, we add a handler in the constructor of EuchreTable:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>AddHandler<\/span> <span>Me<\/span>.Closed, <span>AddressOf<\/span> <span>Me<\/span>.EuchreTable_Closed<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">Then we implement the handler:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> EuchreTable_Closed(<span>ByVal<\/span> sender <span>As<\/span> <span>Object<\/span>, _<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>ByVal<\/span><span> e <span>As<\/span> EventArgs)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>GoAhead = <span>True<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>exitEuchre = <span>True<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">And then we&rsquo;ll alter the TableSleep method to throw an exception so that we can exit the game logic, no matter where we are.<span>&nbsp; <\/span>This is a realy important step &ndash; as we are in the middle of a game, it would be bad if the form went away while we were still executing in the middle of a hand! I&rsquo;ve created a class called EuchreException which just makes it easier for me to determine that it&rsquo;s one of my own exceptions and not a system exception:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span>Class<\/span><span> EuchreException<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Inherits<\/span> SystemException<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> <span>Sub<\/span> <span>New<\/span>(<span>ByVal<\/span> message <span>As<\/span> <span>String<\/span>)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>MyBase<\/span>.New(message)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span>End<\/span><span> <span>Class<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span>Private<\/span><span> <span>Sub<\/span> TableSleep()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>StopPumpingMessagesDuringPause = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EuchreTimer.Start()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>While<\/span> GoAhead = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application.DoEvents()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>While<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>If<\/span> exitEuchre = <span>True<\/span> <span>Then<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Throw<\/span> <span>New<\/span> EuchreException(<span>&#8220;ExitGame&#8221;<\/span>)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>If<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/span><\/span><span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">And in the main loop of the program (which I call &ldquo;NewGameInvoked&rdquo;), we catch the exception and force an exit to the application:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> NewGameInvoked()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp; <\/span><span>Try<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Do<\/span> <span>While<\/span> exitEuchre = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>&#8216; (this is where the game actually happens &ndash; <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp; <\/span>I&rsquo;ve omitted the actual code for brevity&rsquo;s sake)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Loop<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Catch<\/span> ex <span>As<\/span> EuchreException<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>If<\/span> ex.Message = <span>&#8220;ExitGame&#8221;<\/span> <span>Then<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>exitEuchre = <span>False<\/span> <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&#8216; Do nothing; fall through and exit the application<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>If<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Try<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">This may seem a little complicated for a game &ndash; after all, who cares if they have to wait a couple of seconds for the game to exit?<span>&nbsp; <\/span>Or why not just let the AI players operate at warp speed?<span>&nbsp; <\/span>But, at the very least, we *have* to periodically check for messages or we&rsquo;ll never repaint or be able to exit the app until the game ends.<span>&nbsp; <\/span>You might think that we could have simply<\/font><\/font><\/span><\/p>\n<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Coding a Euchre Game, Part 3: Timers In my previous posts regarding the Euchre game creation, I discussed some issues with creating a complex form and maintaining images to be shown on it.&nbsp; In this posting, I&rsquo;m going to start covering some of the more esoteric controls. Timers and Message Pumps Try this:&nbsp; go to [&hellip;]<\/p>\n","protected":false},"author":258,"featured_media":8818,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[22,195],"tags":[101,165],"class_list":["post-6503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matt-gertz","category-visual-basic","tag-matt-gertz","tag-vb2005"],"acf":[],"blog_post_summary":"<p>Coding a Euchre Game, Part 3: Timers In my previous posts regarding the Euchre game creation, I discussed some issues with creating a complex form and maintaining images to be shown on it.&nbsp; In this posting, I&rsquo;m going to start covering some of the more esoteric controls. Timers and Message Pumps Try this:&nbsp; go to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/6503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/users\/258"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/comments?post=6503"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/6503\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media\/8818"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media?parent=6503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/categories?post=6503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/tags?post=6503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}