Learning Goals
I. Further learning Swift's game production
Second, master the use of Sknode,skspritenode
Third, understand the physical system of Spritekit
Iv. Application of Mastery Action (skaction)
In this chapter, we are going to learn more about Swift's game development by making this game of Parkour Panda. First we need to know what kind of game we are going to write. Take a look at the game first.
Parkour Panda is a parkour class game. We will manipulate the fat paper Qinggong, running on a long or short platform, and collecting small apples. The farther you run, the more apples you collect, the higher your achievements. Accidentally dropped the platform, the game will fail. So to do such a game, we have a concept in the brain, we should follow in what order to complete it. We analyze it to form a checklist, as follows:
L We're going to be a panda that can run and jump and roll.
L We're going to create a steady stream of platforms so that the pandas can gallop
L We want to make the background of Parallax movement, make the game look more real
L We're going to produce a lot of little apples and let the pandas collect
L We need to record how long the panda has run and how many apples have been collected.
L We want to make the game more difficult, let the panda run faster and faster
L We're going to add some highlights to the game so that when the pandas take off and roll, there's a dusty effect.
L We want to make different types of platform, let it or drop, or move up and down to increase the fun of the game
L We're going to give the game a background music and some sound effects.
L Finally, we have to judge the game's failure, then reset it and start the new game.
When we have finished this list, we have a whole grasp of the game, we can have a structured and purposeful to write the game of running cool Panda.
1 Creating game engineering and importing footage
First, we open Xcode and choose Create a new Xcode project to create a newly created Xcode item.
Then select the Applicationi,game,next under iOS
Then enter the project name panda,language Select Swift,gametechnology Select spritekit,devices Select iphone, click on the Next button when done
Then select a directory click Create to complete the creation of the game project
Finally because this game is horizontal screen, so we have to make some settings. Click on the panda item in the upper-right corner, and in the General tab, under Deployment Info dviceorientation, remove the portrait and landscape the left hook.
This allows us to complete the creation of the project.
Then we will import the necessary game material into the project, we will import the footage has the panda's sequence frame animation, background, platform, small Apple pictures as well as background music and sound files. The imported project is simple, select the folder of the resource files directly with the mouse, then drag into the project to
My public number.
I wrote a book: "Swift language Combat Promotion" http://item.jd.com/11641501.html
Swift language Combat Promotion-9th chapter game-Parkour Panda-1