Swift game practice-jumping and rolling of the pandatv 04

Source: Internet
Author: User

 

In this section, we use the content learned in the previous section to add jump and scroll actions to the pandatv. At the same time, the touchbegan method is overloaded to respond to the action. Switch run, jump, and roll.

Key points:

 

Generation of animation by serial frame texture:

Skaction. animatwithtextures (texture array, playback interval)

Permanent loop Animation:

SKAction.repeatActionForever() 

Click Event

Reload the touchbegan method to respond to the click action.

Override func touchbegan (touches: nsset, withevent event: uievent) {// code}
Project file address

Http://yun.baidu.com/share/link? Consumer id = 3824235955 & UK = 541995622

 

Swift game practice-game preview for the parkfun series 00 01 project import materials 02 create a pandatv 03 Animation
Related 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.