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