title: make speed 5 when shift key is pressed
body: <p>i have the following code to make my player move:</p>
  
  <pre><code>class Player {
  
    PVector direction;
    PVector location;
    float rotation;
    int speed;
  
  
    Player() {
      location = new PVector(width/2, height/2);
      speed =2;
    }
  
    void visualPlayer() {
      direction = new PVector(mouseX, mouseY);
      rotation = atan2(direction.y - location.y, direction.x - location.x)/ PI * 180;
      if (keyPressed) {
        if ((key == 'w' &amp;&amp; dist(location.x, location.y, direction.x, direction.y)&gt;5) || (key == 'w' &amp;&amp; key == SHIFT &amp;&amp; dist(location.x, location.y, direction.x, direction.y)&gt;5)) {
          speed = 2;
          location.x = location.x + cos(rotation/180*PI)*speed;
          location.y = location.y + sin(rotation/180*PI)*speed;
  
          if (key == SHIFT) {
            speed = 5;
          }
        }
      } else {
        location.x = location.x;
        location.y = location.y;
      }
  
      println(speed);
      ellipse(location.x, location.y, 10, 10);
    }
  }
  </code></pre>
  
  <p>when i press the w key the player moves in the direction of the mouse. but i want to make the player move faster if i press the shift key. but now my player stops moving when i press the shift key... why is this happening?? any suggestions to help me fix this problem are welcome :)</p>