# Need help making grid move with variable

**URL:** <https://discourse.processing.org/t/need-help-making-grid-move-with-variable/36225>\
**Category:** Coding Questions\
**Created:** [April 9, 2022, 2:55am UTC](https://discourse.processing.org/t/need-help-making-grid-move-with-variable/36225 "2022-04-09T02:55:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voleia](https://avatars.discourse-cdn.com/v4/letter/v/b77776/32.png) [@Voleia](https://discourse.processing.org/u/Voleia)\
**Post date:** [April 9, 2022, 2:55am UTC](https://discourse.processing.org/t/need-help-making-grid-move-with-variable/36225/1 "2022-04-09T02:55:47Z")

</div>

Hello! First of all, I’m new to processing and haven’t done much coding of any sort in a while. I feel like this should be really easy, but I’m having trouble for some reason. I’m trying to create a small game. I have variables called RelativeCenterX and RelativeCenterY, and when I change those everything in the canvas moves except the player’s object. One of the things that moves is a grid with 25x25 squares, and I want to make it so that when the mouse hovers over a specific spot on that grid, it is outlined in white.

The code I have for outlining it is simple,

`stroke(255);

strokeWeight(2);

fill(0,0,0,0);

rect(round((mouseX-12.5)/25)\*25, round((mouseY-12.5)/25)\*25, 25, 25)`

but I can’t figure out how to make that outline move with the grid. I want to make it so if I increase RelativeCenterX by 15, the outline moves to the right 15 pixels and the area where I put my mouse to activate it moves right by 15 pixels.

Any Tips? I feel like this should be really easy but I’m still having trouble.
