q,
d and
r are not very descriptive so I can't tell for certain what your intentions are for them.
However,
r is just another single pointer. Assigning to it "new Node" allocates memory and creates a new one in the same way it does when you assign it to
list. This is completely separate from the list's node and will be lost when a new one is assigned to r then following time, probably leading to memory leakage.
A node's
next member is surely the one that should point to the next node?
Maybe (I'm not sure as I haven't learnt and stepped through your code) instead of creating a new node where the node is null, create it when then next member is null. For example (untested):
// iterate until you reach the first null "next"
while (r->next) // (!= NULL)
r = r->next;
// create new node directly on the next pointer
r->next = new Node;
// point r at the new node
r = r->next;
// rect setup
r->rect.setSize(sf::Vector2f(25,25));
r->rect.setPosition(25*q,25*q);
// nullify the next member of the new node
r->next = NULL;
// counter?
q++;
std::list is very easy - much easier than safe manual pointer work
However, if you don't
need a linked list, the default storage container should most likely be an
std::vector.