Original: Swift game combat-Parkour Panda 03 Panda running animation
In this section, we'll use skaction to create animations for pandas, and we'll learn to animate through texture groups, using the perpetual cycle of skaction to keep the panda running.
Points:
use of enumeration: used to record the action status of a panda
enum Status: Int {
Case run = 1, jump, jump2, roll // When run is assigned a value of 1, jump, jump2, roll will be automatically assigned a value of 2,3,4
}
Animating with sequence frame textures:
Skaction.animatwithtextures (texture array, time between playback)
Cycle Animation Forever:
Skaction.repeatactionforever ()
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
Swift game combat-run Cool Panda 03 panda running animation