You first need to figure out how you want to draw a snake, since they can have different lengths or directions.
If you just use shape, you'd need to calculate the correct rotation for a start and end point yourself or you could also check out the LineShape someone wrote once.
But if you then have different textures for the snake or ladder, you'll have to come up with a way to add more sections of the given texture.
after searching answers on the internet, i think that problem is solved, here's what i've done to my code, but i have a new problem and i don't know what to do, here's the code
void Board::render(RenderTarget& target) //<- this is RenderWindow from the main game.cpp
{
node* temp = head;
while (temp) {
if (temp->jump->location > temp->location) {
float distance = pow(temp->locx - temp->jump->locx, 2) + pow(temp->locy - temp->jump->locy, 2);
distance = pow(distance, 1 / 2);
float scaley = distance / laddersprite.getTexture()->getSize().y;
laddersprite.setScale(5, scaley);
laddersprite.setOrigin(laddertexture.getSize().x / 2, laddertexture.getSize().y);
float angle = atan2(temp->jump->locy - temp->locy, temp->jump->locx - temp->locx);
laddersprite.setRotation(angle);
laddersprite.setPosition(temp->locx, temp->locy);
target.draw(laddersprite);//<--it triggers breakpoint here
}
else if (temp->jump->location < temp->location) {
}
temp = temp->next;
}
}
i'm pretty new with SFML and i never encountered problems like that, i used linked list for the game and jump is snake/ladder target tile(as a node), locx and locy is basically the position of the tile