// Update is called once per frame void Update() { if (!pause.Paused) { if (Input.GetKeyDown(KeyCode.Space) && !IsMoving && !SpacePressed) { nextNode = statePlayer.Action(this); index = 0; next = TheGrid[(int)(Actual.Pos_x + nextNode.x), (int)(Actual.Pos_y + nextNode.y)]; index++; level.DecreaseMoves(); } if (Animation()) { if (IsMoving) { Move(); } } } }