Some bugs need to be dealt with, such as the bird is too high or too low should be an error (or fall directly under the window), this method with the front of the HitTest should be independent, not mixed together
?
The test can really detect if the boundary is exceeded (if you want to be very precise, it's not just a comparison of the width and height of the form, but the width and height of the bird itself).
?
In addition, the birds and tubes should be replaced with some background pictures, instead of only fill the color, here is simply the use of ordinary pictures (especially the tube will be ready to zoom, or the effect is not ideal, if you want to make the game very delicate, you need to carefully study how to put pictures in the custom polygon)
?
By this opportunity, I have drawn, fill the background color, fill the texture are separated (note that the Fill rectangle two function name is the same, and the function of the input is not the same, this is called overloading, you sometimes enter a Microsoft-provided function, which prompts you to +3 overloads, it means that there are other three of the same name function, but the function input The advantage of using overloading is that the whole class is more concise and you hit the class name somewhere else. After that, a bunch of properties and methods will not appear too much, too verbose, because you already know what parameters to give, and he will be able to execute any method.
?
To make the game more difficult, we need to generate tubes from above and below.
?
This requires rewriting the previous pipe's Init method, which would have been just a long way from somewhere in the middle, and now there might be a brush at the top, with a random height value (note that using existing code as much as possible has reduced duplicate code)
?
Summary: So far this little game has been developed (can be perfected a lot of features, such as how the birds flapping wings, how to pause/continue to run, how to die after a similar to the resurrection of the potion can choose, like the Temple escape, every day cool to run these games how to do gold coins reward, etc.), The reader needs to carefully understand the process from the idea to the final realization of a complete program.
1 Think about which one is the most difficult, the most uncertain of the whole project, and want some small experiment to verify his
2 frame Each object, such as a referee, a bird, a pipe, what properties and methods are required for each object
3 gradually improve the method of each object (most of the time we can not think of the beginning is very clear all the properties and methods, which need to write a part, after the verification is done to change)
4 finally consider not very important features (such as integrals, replacement pictures, game bonuses, etc.), rather than spend a lot of time in the beginning to think about how to do the button is very beautiful, the element movement is very smooth
5 After the completion of the project to extract a meaningful method, individually encapsulated into some class library, convenient for their later use, to have good habits at any time to organize in various aspects of the class library (also including the online good post to save the backup)
?
?
For more instructional videos and downloads, please pay attention to the following information:
My Youku Space:
Http://i.youku.com/acetaohai123
?
My online forum:
http://csrobot.gz01.bdysite.com/
?
Problem Exchange:
qq:910358960
Email:[email protected]
?
?
?
?
?
?
?
C # Basic Video tutorial 7.5 How to write a simple game