Summary of webgame Combat System

Source: Internet
Author: User

I haven't updated my blog for a long time! On the one hand, I recently made a girlfriend, so my mind is inevitably not in the status; on the other hand, I am also developing specific logic recently. It is difficult to share some summary and other things with you, let's share with you the combat skills that have been tested recently! A new skill system and Combat System Based on secondary development. The previous combat system was too messy to write, and a recursive function + timer was used; it was unable to read in the cluster; it was overturned and re-designed. As I am a newbie in the skill battle field, I am always afraid to dig holes for myself. In addition to java that I am not familiar with, I am always careful in the design or actual coding process!

Let's take a rough look at uml!

This is the design of the original skill version. In actual projects, the parameters are corrected, and an abstract skill class is added between the Skill Class and the skill interface, after all, a lot of skill data can still be extracted! Compared with the previous skill system, I used the factory mode and Strategy Mode here! Benefits of object-oriented!

This is the initial design version of the buff system. Later versions are the same. Many modifications have been made to add a buff abstract class!

This is a combat auxiliary system. It mainly selects attack objects and release skills! The actual version has made many modifications to the parameter!

In the actual development process, many problems have been encountered, such as exception handling. before writing C ++ code, exceptions were rarely used, unless they were database access; in other aspects, we should make enough judgments. It is useless to handle exceptions if the NULL pointer field pointer is used. However, many exception handling functions are compiled during java development!

Several java container classes have also made many mistakes. For example, you should be very careful when using the toArray () function of List! I threw a lot of exceptions on this!

But fortunately, in the end, the Code complexity is still within the controllable range, and we should re-engineer it in the debugging process!

 

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.