The first two days to do a push box games, seemingly simple a small game behind there is a huge secret, this secret is a lot of logic.
Since learning the function, it really solves a lot of problems, and the invocation is very convenient, although I am not very good at now.
After writing a function, prepare to test the time of B. The first is to solve the problem of the goal, using a structure to
Positioning. Then you have to locate the location of the villain, the output map, the walls, targets and boxes are replaced by numbers.
So, set the map to two axes x y this solves the problem of moving the villain, and the map is used as an array of components, using X
Y +-will be able to move the problem, but there is a need to move the box together. The most important thing is that the moving body moves around when it
parameters, such as walls and two boxes together, there is always no way to push a box on the wall. In the end it is
Determine whether the clearance, and then output, in fact, if the direction key is the char type to the back of the output is very convenient, do not need to replace. This
This is the two days to write about the contents of the box.
C-Language game push Box