The player class in sports games

Source: Internet
Author: User

Recently in a baseball game, began to feel very cool, but in fact, the practice is very simple, the imagination of the players is how smart, so that, in fact, is just appearance.

The class of players is a very important part of the game, how to write this thing, you can write ...

Baseball and football basketball is not the same, more difficult than him or simpler, reckoned thinking may not be the same, did not do, do not understand, there is an artificial intelligence programming what, there is an example of football, just look at the book to get out, hanging ... Most of the behavior of our players can be this: let him run to some point, run to, play animation .... For example, to pick up a goofy ball. The basic function is to turn around and run, plus a bunch of other things that are labeled. Then use an enumeration variable, indicating the current state, such as the catch, the catch state is to turn first, and then let him run to a point, this point is of course the ball flew to the landing, in advance know the ball landing is necessary. Of course, you have to run ahead, play the animation ahead, and then when the animation just hands up, the ball falls into hand, but .... This is not good to do, so, some games feel the ball to wear the past, and back to the hand, it is normal, because I also met ... The machine frame rate is not stable such a reason, cause the ball movement and the calculation of different also quite normal ... Finally do a similar big situation a deal, there is a situation, to co-ordinate the status of everyone, A to catch, B to occupy the base. Like basketball, I attack, must have two points, no matter how the player operation, the result is two points, although a bit false, but this is a lot of benefits, such as if this is a network game, you only need to send the results past, two points to a variety of ways, but the result is the same, In the client only need to choose a situation to express the line, wrote the server share said, different machines on the face of the same operation caused by the situation is not the same as a big pit. Of course, the basketball situation, very complex, should not do so, but baseball is not the same, the basic situation of baseball is more easily summed up ... Anyway, just do it anyway ... There is a problem, then yy, if you make more of the situation, still can play a play. In this way, processing will be more, but the idea is simple and plain, if you go to write an AI, oneself decide what to do, first of all, this is very difficult to write, the effect is a problem, the situation is very complex, and everything is really not easy ...

Finally, I hope this project can have a good result.

Note: This is also the main reference to the implementation of the XX game method.

Note: I think it is more appropriate to copy this word to replace the reference ...

The player class in sports games

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.