title: Scala Type Mismatch, Can't Resolve the Problem
body: <p>So, for a project, I'm trying to make a specific piece of a game generated block move. All coordinates are stored in a List and through &quot;x&quot; and &quot;y&quot; values I should be able to add up to the coordinates, and in turn make the block move.</p>
  <pre><code>  def movement(move: Point): Unit = {
      val newList: List[Point] = placed
      val xx = move.x; val yy = move.y
      for (i &lt;- newList.indices) newList(i) += Point(xx, yy)
    }
  </code></pre>
  <p>Here, &quot;placed&quot; is the List where all coordinates are placed. The &quot;Point&quot; type refers to the &quot;x&quot; and &quot;y&quot; values.</p>
  <p>The problem here is that when I try to add the new values to the coordinate, it says:</p>
  <blockquote>
  <p>Type mismatch. Required: String, found: Point</p>
  </blockquote>
  <p>I found this strange, since my list is not initiated with the string type. Is there any way to work around this problem?</p>
  <p>Many thanks.</p>
  <p><strong>Added example of previous project:</strong></p>
  <pre><code>  var playAnimal: List[Point] = List(Point(2,0), Point(1,0), Point(0,0))
  
    def checkForWrap (p: Point) : Point = {
      var x = p.x; var y = p.y
      x = if (x &lt; 0) nrColumns - 1 else if (x &gt; nrColumns - 1) 0 else x
      y = if (y &lt; 0) nrRows - 1 else if (y &gt; nrRows - 1) 0 else y
      Point(x, y)
    }
  
    def moveAnimal(): Unit = {
      if(!gameOver) {
        def newAnimalFront: Point = {
          val newHead: Point = currentDir match {
            case East()  =&gt; playAnimal.head + Point( 1,  0)
            case West()  =&gt; playAnimal.head + Point(-1,  0)
            case North() =&gt; playAnimal.head + Point( 0, -1)
            case South() =&gt; playAnimal.head + Point( 0,  1) 
          }
          checkForWrap(newHead)
        }
        playAnimal = newAnimalFront +: playAnimal.init
      }
    }
  </code></pre>
  <p>This method, however, is displaying the String mismatch in my current project.</p>