<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Steve</title>
    <description>The latest articles on DEV Community by Steve (@sehardwick).</description>
    <link>https://dev.to/sehardwick</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F290366%2F7a7ec729-4a1a-4220-91cc-855e8734c5a4.jpg</url>
      <title>DEV Community: Steve</title>
      <link>https://dev.to/sehardwick</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sehardwick"/>
    <language>en</language>
    <item>
      <title>Set an inaction timeout in JavaScript</title>
      <dc:creator>Steve</dc:creator>
      <pubDate>Fri, 13 Dec 2019 21:50:20 +0000</pubDate>
      <link>https://dev.to/sehardwick/set-an-inaction-timeout-in-javascript-2mdi</link>
      <guid>https://dev.to/sehardwick/set-an-inaction-timeout-in-javascript-2mdi</guid>
      <description>&lt;p&gt;I posted a question here yesterday regarding being able to set an "inaction" timeout that would reset a JS game:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/sehardwick/help-js-scripting-question-2cda"&gt;https://dev.to/sehardwick/help-js-scripting-question-2cda&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy to say that with a little guidance, Stack Overflow research, and testing, I was able to come up with a solution! &lt;/p&gt;

&lt;p&gt;After declaring &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; variables, I created a setTimeout method that called a function that was then defined with an alert and the necessary code to reset the game, and I ended up with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;setTimeout(functionName(), 15000) //to set a 15 second inactive period
  function functionName() 
    {
    alert("text message along with counter displaying how many correct guesses the player had")

//Remainder of code to reset the game 

    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Super-psyched I finally got this to work!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Help! (JS scripting question)</title>
      <dc:creator>Steve</dc:creator>
      <pubDate>Fri, 13 Dec 2019 00:08:48 +0000</pubDate>
      <link>https://dev.to/sehardwick/help-js-scripting-question-2cda</link>
      <guid>https://dev.to/sehardwick/help-js-scripting-question-2cda</guid>
      <description>&lt;p&gt;I've been coding for a grand total of three weeks, and have learned just enough HTML5, CSS, and JS to be dangerous.&lt;/p&gt;

&lt;p&gt;I've created the typical click-the-smiley-face game for my JS class, and I'd like to add a feature not covered in the curriculum. Hoping someone can point me in the right direction without actually giving me the answer - I'd like to figure it out on my own as much as possible.&lt;/p&gt;

&lt;p&gt;I'm calling the function startGame(), and when the user clicks anywhere but the designated target, it calls the gameOver() function. &lt;/p&gt;

&lt;p&gt;I'd like to set a timer for ten seconds that, if no selection is made, the script will automatically call the "onclick=function gameOver()" command.&lt;/p&gt;

&lt;p&gt;I've played with various iterations and placements of setTimeout() and clearTimeout(), but can't seem to get it to work.&lt;/p&gt;

&lt;p&gt;1) Am I on the right track? Any tips on scripting this?&lt;br&gt;
2) Is it possible to display a small countdown clock in the upper right hand corner?&lt;/p&gt;

&lt;p&gt;Thanks in advance for any help or tips you can throw my way! &lt;/p&gt;

&lt;p&gt;(Not sure of the rules regarding this, but I can post a link to my codepen if that's allowed.)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>timer</category>
      <category>settimeout</category>
    </item>
  </channel>
</rss>
