Modern Software Engineering Series Pair Programming two weeks to write 3D land war

Source: Internet
Author: User

From: http://cid-ba6a52af193f301f.spaces.live.com/blog/cns! BA6A52AF193F301F! 122. entry

Oh, my pair project

From new Pair (HuangShuo, WangGuan)

Check in the code, send an email, and close the Flex Builder. After almost two weeks of tangle, the Pair Project finally had a knot. At this moment, I am very relieved to come to the code field.

We Pair, Wang Guan, and I are basically dumb-eyed when we are dealing with this job, because there is nothing except Writing C and Java. When I found the lack of Silverlight online tutorials and heard some people talk about Flex, we chose Flash + Papervision3D class library to implement our 3D land war games. Of course, nothing remains.

Let's start crazy Baidu, search for various keywords such as Flash3D and pv3d tutorials, get the source code, and try it on the machine. In our initial Pair Programming, we started by trying to run the source code out of the Internet. However, it is basically a tragedy and constant attempt, but I still don't know how to display the Rotated Cube in MXML.

All knowledge is new to both of us. I don't think the Pair Programming can be implemented in this case. You must first set the foundation. So we started the division of labor, WG began to study the 3D extension of the rules of the land war, and I began to tackle the flash 3d graphics.

Thanks to the popularity of flash, there are indeed many tutorials and various personal homepages. I started to read the tutorials, tune the code, and then send an email to the author of every tutorial I could find to ask a question. After a few days in the dark, I finally gradually saw the light. The Cube turned and pulled up the angle of view. Finally, a cool man returned to my email, finally, we sent 13 emails back and forth.

After I learned how to set up the canvas, I told WG to let him design the canvas. After several arguments, he probably determined the view of the canvas. I told WG how to write the code, and then he started to implement the code of the checkerboard line. When WG finally made a correct chessboard, it dragged the exquisite space grid and felt the 3D effect we had made. It was a godlike work of art.

By constantly reading Papervison3d APIs and continuously trying code, I finally felt I could start my own project.So we performed the most critical Pair Programming in the project. We completed the class design and program structure design of the entire project in the machine room using the Compilation Time. Let's analyze the class together, find the attribute, write the method header, start with WG using the keyboard, and then I use it. One obvious benefit is that after writing a statement that you are not sure about, you can immediately share your thoughts with Pair. After one afternoon, I felt very fresh, because I finally understood the practice of this project.

Next, the Division of Labor began. I am doing something about the appearance of the image. This is easy to test and does not need to be done by two people. WG writes a lot of internal logic processing code. At this time, we started the most commonly used Pair Programming in the project, that is, WG started to run with his code. I didn't have any subjective bias caused by code writing, it is very suitable for a test sample. If the code goes wrong, we will immediately discuss the logic of this event from a more abstract level. Finally, the WG will give a clear explanation, return to the code level and quickly change the code to continue the above process. At this time, it is common that WG is sitting in front of the computer. I stood behind him, walked around, and leaned over and used the mouse to show the test example. WG turned around to discuss it with me, go back and change the code.

Military chess is inherently troublesome. In addition, each of our chess pieces has three textures, which are displayed at different times to enhance the user experience. Therefore, for the logic of changing textures and eating each other, we have repeatedly Pair so many times, changed numerous bugs, and unfortunately introduced numerous bugs. Finally, we can only find bugs that we cannot find. In fact, there may still be bugs. Because there are a lot of similar logic code in Junqi, we use a lot of code that is directly brute force enumeration, and debug together without writing the Code together, I think this method is successful, instead of wasting time on code with a large amount of logic and simple typing.

Now I have basically finished this assignment. I think it is still a lot of lessons.

One experience is that it is really useful to learn basic things well. The basic help of Java basically does not take much time in the syntax and usage of ActionScript. Another proven experience is that the search engine is a good thing with the Internet, it seems that no "popular" technology can be mastered. Of course, it may take a few days.

The lessons are more embodied in the overall design. In the beginning, we didn't understand anything about flash3d. We didn't care too much about the use of object-oriented analysis and design methods. In many places, I am a little casual, if you can draw a class chart and analyze the use case in the beginning, you may not suddenly find that the important attributes cannot be obtained. You need to change a lot of code. Then there is some logic. At the beginning, we didn't fully analyze it clearly. We didn't use very elegant processing methods to write the program. Later we changed the code and could only use if to write it to the end, some code is really ugly.

The whole process also gave us a personal experience on some issues. The most obvious thing is the "regression test". I have never believed in its necessity before. This time, the code to change the logic of the game can be seen as how important regression testing is, many times I changed the display of a Paster, and the new problem came out again...

It was just less than two weeks ago that I looked at Papervision3D's api helplessly. Some of them wanted to give up this job. After a few days, I was able to make something, but now I can code the code, there is a feeling of darkness before dawn. I will remember this project for a long time.

Finally, let's talk about the problem. During the debugging, the program crashed and IE was forcibly disabled. I lost the blue screen of vista twice. In addition, Flash3D does not support hardware acceleration now, all of them are calculated by the CPU. In these days, my CPU is close to 100% for a long time. Maybe Flash3D will be able to use some graphics card. I should try this Pair Project again, let the CPU look at the output of the video card, it is a breeze.

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.