Hello guys i have a logical problem...i had to do a kinda fo labyrinth and it work but then im trying to do it with classes...so here it is.
i have a function outside of main called void playeraction();
cout<<"\nAction : ";
cin>>action;
int prevX=posX;
int prevY=posY;
unsigned char space = {32};
switch (action)
{
case 'a':
if(grid[posX][posY-1]!='#')
{
posY--;
grid[prevX][prevY]=space;
system("cls");
break;
}
when its like this the character moves without any problem now when i try to implimenet classes it doesnt
case 's':
if(grid[posX+1][posY]!='#')
{
Dragon obj;
obj.moveSouth(posX);
grid[prevX][prevY]=space;
system("cls");
break;
}
in dragon cpp
int Dragon::moveSouth(int posX)
{
return posX++;
}
any ideas why it doesn't return the posX++
??