Hello,
I am working on this program that simulates a fox and hounds game. In this program there are four buttons, each controlling one piece to any of the four diagonal directions. If it gets to the edge, the corresponding buttons will hide. I am currently having trouble with some functions. But I think im not using the right command. Here is my code for the class corresponding to the game window. Forgive me for the mess, this was just a prototype.
Please enclose your code with [ code ] [ /code ]. Makes it a lot easier to quickly catch up on your code.
Otherwise, state what specifically is your problem. Saying
I am currently having trouble with some functions.
is very vague.
From general inspection. I can see a logic fault in your move functions. Don't have an if-else statement. Rather place the if function at the end of the code after the move and redraw. That way the player may still be able to legally move and at the end of that move. The program will determine whether he can carry on moving in that direction or not. If not, the button will become hidden.
It was working fine when all i had in the function was the move and redraw, but when i put the .hide in it, it tells me this
error: invalid use of member (did you forget the & ?)
error: request for member 'hide' in game_Window::m1, which is of non-class type void()(void * void*)
I am really confused about this, any help please?