hiya guys sorry if this seems trivial but ive tried all i can.
im making a tile based game/engine and have a free roaming sprite (which i will turn into a tile at a later time)
the problem is that i have 4 status's up,down,left,right for my sprite and want to animate it.
Code:
void Dot::show()
{ if((xVel==0)&&(yVel>=0))
{
statu = &down;
//frame++;
//apply_surface( box.x - camera.x, box.y - camera.y, dot, screen,&clipup[frame] );
}
else if ((xVel==0)&&(yVel<=0))
{
statu = &up;
//frame++;
}
else if ((xVel<=0)&&(yVel==0))
{
statu = &left;
//frame++;
}
else if ((xVel>=0)&&(yVel==0))
{
statu = &right;
//frame++;
}
//else {frame=0;}
//if(frame>=3)
// {frame=0;}
if(*statu==up)
{
apply_surface( box.x - camera.x, box.y - camera.y, dot, screen,&clipup[frame] );
}
else if(*statu==down)
{
apply_surface( box.x - camera.x, box.y - camera.y, dot, screen,&clipdown[frame] );
}
else if(*statu==left)
{
apply_surface( box.x - camera.x, box.y - camera.y, dot, screen,&clipleft[frame] );
}
else if(*statu==right)
{
apply_surface( box.x - camera.x, box.y - camera.y, dot, screen,&clipright[frame] );
}
}
theres some code i set the status (statu i evan changed the name incase that was the problem) so that it can use which ever set of animations it needs but after it has moved once it resets to facing down.
at first i didnt have pointers at all but i thought that could be the problem but it didnt sovle it any help would be much appreciated thanks in advance
edit:i have tried to debug it to see where in my code it resets but it says:: There is no source code available for the current location.::
any ideas why i get that message?
edit:edit: ok ive solved the reseting problem i was checking for>= and <= needed just > or <
but i still get the debugger problem any ideas?