Hi, i'm new with sfml, and i'm getting some problem in my first game, hope there is someone to help me.
I'm going to create some kind of puzzle games, but the game not going as i wanted, there's something wrong in my code, when i click on my sprite, it's moved to different possition as i want, but don't know why its going back to the same position after some milisecond, but when i delete "Area[temp]=Area[GetMouseClick()];" its moved, but its only worked when we click the sprite that hasn't clicked before. [note : it's only happen when the empty space is at right bottom corner]
this is my code :
if (GetMouseClick() && moveAble(GetMouseClick()))
{
temp=0;
while (!isAreaEmpty(temp))
++temp;
piece[Area[GetMouseClick()]].SetPosition(GetCord(temp));
Area[temp]=Area[GetMouseClick()];
Area[GetMouseClick()]=0;
}
}
there is no error appears on my compiler, and i'm using SFML 1.6 on Code::Blocks 10.05
sorry for my bad english