Swift game combat-Mobile for Parkour panda 07 platform

Source: Internet
Author: User

This section allows us to implement how the platform produces mobile animations.

Points

1 using an array to store the platform

var platforms=[platform] ()

2 new platform generated to store in array

Platforms.append (Platform)

3 Use the Update method of the home view to constantly invoke the Move method of the Platform factory class

Override func Update (currenttime:cftimeinterval) {        platformfactory.move (self.movespeed)}

The 4 Move method receives a parameter that is the speed at which the platform moves. Moving animations through a for-traversal platform in the platform array with x-coordinate changes

func Move (speed:cgfloat) {        for-in  platforms{            -= Speed        }}
Project file Address

http://yun.baidu.com/share/link?shareid=3824235955&uk=541995622

Swift game Combat-Parkour Panda Series 00 Game preview 01 Create project Import footage 02 Create Panda Class 03 Panda run Animation 04 Panda jump and Roll action 05 how the platform was made 06 create platform classes and Platform factory classes
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.