I currently have an issue regarding local variables in a method. The method is made to spawn a line of square sprites along the bottom of the screen.The code currently looks like so:

```
 public void spawnFloor()
    {
        for (int x = 0; x < floorSize / texture.Width; x++)
        {
            if (walls.Count < floorSize / texture.Width)
            {
                positionModifier.X = texture.Width * x;
                position.Y = floorStart.Y;
                spawnWall();
            }
        }
    }

```

Currently, when the game resolution is 1280/720, the game spawns 40 squares at the bottom right corner of the screen. The value of x is apparently 0 throughout. Any ideas? Below is the code of the class in it's entirety in case it's something class based:

```
    public WallManager(Texture2D texture, Vector2 floorStart, int screenLength)
    {
        this.texture = texture;
        this.floorStart = floorStart;
        floorSize = screenLength;
    }

    public void spawnWall()
    {
        Wall thisWall = new Wall(position*positionModifier, texture);
        walls.Add(thisWall);
    }

    public void spawnTest()
    {
        if (walls.Count == 0)
        {
            position = new Vector2(0, 698);
            spawnWall();
        }
    }

    public void spawnFloor()
    {
        for (int x = 0; x < floorSize / texture.Width; x++)
        {
            if (walls.Count < floorSize / texture.Width)
            {
                positionModifier.X = texture.Width * x;
                position.Y = floorStart.Y;
                spawnWall();
            }
        }
    }
    public void Draw(SpriteBatch spriteBatch)
    {
        foreach(Wall wall in walls)

        wall.Draw(spriteBatch);
    }
}

```

Edit: As suggested, the wall class has been posted:

```
public Wall(Vector2 position, Texture2D texture)
    {
        wallPosition = position;
        wallTexture = texture;
    }

    public void Update(GameTime gameTime)
    {
        wallWidth = (int)Math.Round((double)wallTexture.Width);
        wallHeight = (int)Math.Round((double)wallTexture.Height);
        wallHitbox = new Rectangle((int)wallPosition.X, (int)wallPosition.Y, wallWidth, wallHeight);
    }

    public void Draw(SpriteBatch spriteBatch)
    {
        spriteBatch.Draw(wallTexture, wallPosition, wallColor);
    }

```

Also, positionModifier is a private Vector2 in the wallManager class with the value (1,1) on startup