C-Language game push Box

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.