title: Game Maker Code doing the opposite?
body: <pre><code>if keyboard_check('D')
  {
      x = x + 4
      sprite_index = spr_playerRight
  }
  </code></pre>
  
  <p>As soon as I start the game, the player sprite will start moving to the right. But, as you can see, that shouldn't be happening... right?</p>
  
  <p>When I actually do press D, it does the (Else) portion of the little chunk.</p>
  
  <p>Any idea why this is happening? I'm a bit new to this.</p>
  
  <p>Edit: I was messing around a little and I swapped the code (the IF from the else) and I would not move at the start, but pressing any key would cause me to move.</p>
  
  <p>Another Edit: The fact that the Else would apply any time the D key is not applied made me realize that (if this did work properly) the else on this would intrude on attempts to move other directions (Pressing any button will stop the movement)</p>
  
  <p>Another Edit: I changed the keyboard_check to
  keyboard_check(vk_right)
  And it works perfectly fine. I believe this is simple a problem on how I declared the key... <strong>How do I declare keys properly?</strong></p>