Kevin lynx
2007-1-30
Crazy eggs clone is just a clone (I used the art and music resources of the original game), but it can be said that this game is the game with the highest degree of completion so far. It can be said that in terms of the degree of completion, it is higher than the previous brick shooter Jr!
Crazy eggs clone uses the PopCap framework engine. Before this game was developed, I only had access to this engine for four days. It can be said that this game is used to practice using this engine. When the level editor is added in four days, a total of more than 6000 lines of code are generated. It took me 6 days to write more than Brick shooter Jr 4000 lines of code. I think this is mainly because the crazy eggs game is less difficult, although it needs to handle more things than Brick shooter Jr.
After brick shooter Jr was completed, it was October that I spent a whole month on the clone of a very beautiful scroll game. I have read some tutorials written by foreigners and intend to translate some of them, but I still have to give up on this idea for time reasons. (Dx, OpenGL, but not development of a type of game in China) during this period, I also came into contact with the application of game monkey in the game and the application of XML in the game, and more knowledge about OOD and OOA. This clone fails later. Then, I continued to learn some object-oriented software engineering knowledge and used a week to create a smaller horizontal scroll game, but it was just a demo, it is used to practice the demo of object-oriented development. Then prepare for the exam. Then I learned Java. It took 20 hours to write a small game and December lines of code at the end of 3000. Gaming is not difficult, and code is not difficult. This 3000-line code has not been debugged! A series of disgusting problems with memory leaks have never occurred! (Some of them appear in crazy eggs clone)
Then, I fell into full emotional embarrassment, and the test was depressing. The entire December year was quite depressing!
After the test, I have been in touch with the PopCap framework on July 7, middle January. Then we made this practice.
Some experience feelings must be recorded:
1. A framework may be better than an engine in some cases! The framework can make it easier for you to build an architecture. It will also teach you some good design methods. What about the engine? The engine provides interfaces to the outside. Of course, you can inherit the classes in the framework to implement expansion, but the engine does not "lead" This function! Compare PopCap framework with HGE. PopCap has the concept of Widgets. Many things can be seen as widgets: the game master controller (usually designed as the cgame class), The Renderer (designed as the crendermgr class by me ), can be seen as widgets. Once you have designed widgets, you can use the PopCap widget manager to help you do many things. That is to say, PopCap is really a framework. What you need to do in the framework is to fill in the content and it is required. You cannot create a program without filling in the program. Therefore, you must inherit the sexyappbase class and the widget class. After the inheritance, you must enter the actual content in these interfaces. After filling in, your game (Program) will be built up. Therefore, the framework helps you design your architecture.
What about the engine? Taking HGE as an example, HGE provides you with the reference pointer (hgecreate) of the core module. You can use this pointer to call some functions to implement what you want to do and detect input, rendering pictures and so on. However, HGE does not allow you to create instances of core modules-you cannot create new objects. You do not need to inherit some of your classes provided by HGE, even some helper classes. Even if you inherit, you only need to expand functions. This is not necessary. In other words, the engine provides you with tools and methods. But what do you do? It is not specified what you do. When you design (Architecture), the flexibility will be high. Whatever architecture you want to do! However, it is because you do not have to limit your architecture to make your architecture more difficult. (MASTER exceptions)
The design ideas in the framework are also worth learning, such as the concept of PopCap widgets. As you can imagine, the various objects in the game world basically contain the logic update and rendering behavior. Therefore, Widgets provide update and draw functions-require you to reload and fill in the actual code (of course, the framework will fill in some basic code for the convenience of users ). This is also reflected in HGE. Many classes in HGE (basically all helper classes) include the update and render functions!
2. The program will crash in debugging mode. This may be the cause of the development kit. Some items require some settings, but I may not have done so. After the game was released, I tested it many times and it was okay in the release mode. The error should be caused by the debugging settings of the Development Kit I have not done. In short, no matter how the program is written, I need to think more closely! In terms of pointers, allocated memory needs to be released, and so on.
3. I thought about the classiclink algorithm of crazy eggs clone. Not simply search for answers. Well, there are regular searches. The speed is much faster than normal recursion (or converted iteration!
To put it simply, this algorithm (used for video games): After a player selects two points, the two points are used to separate the horizontal and vertical parallel lines, the line segment is the endpoint where it is unavailable, so we get two lines, and then we can check whether the two lines can be connected.
PS:
Crazy eggs clone download: mail me (zmhn320@163.com) to source code ):
Http://blog.blogwhy.com/azjex/upload/crazyeggs.part1.rar
Http://blog.blogwhy.com/azjex/upload/crazyeggs.part2.rar