// capture the x and y grid positions as variables
let x = grid x position;
let y = grid y position;

if () {
  draw red dot;
} else {
  do nothing;
}