HTML 5 2D Game development: Implementing Sprite behavior

Source: Internet
Author: User

Good stories are inseparable from good personas. Like books and movies, video games also require personas with interesting behavior. For example, the protagonist in Braid (always the best-selling platform game) can manipulate time. The game is made to stand out by clever behavior.

Behavior is the soul of any video game, adding the behavior to the lazy sprite implemented in the previous installment for Snail Bait will immediately make the game more interesting, as shown in Figure 1:

Figure 1. After completing this article, the state of Snail bait

Recalling the Sprite object section of the previous article, Snail Bait's Sprite did not achieve its own activities, such as running, jumping or angry. Instead, Sprite relies on other objects (called behaviors ) to control operations.

Fig. 1 shows the snail's act of shooting a snail bomb. Other behaviors that cannot be seen in the static image in Figure 1 include:

Running villain

Buttons move back and forth on the platform

Rubies and sapphires shine brightly

Table 1 summarizes these behaviors:

Table 1. The behavior discussed in this article

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.