官术网_书友最值得收藏!

Cleaning up

I hope that you have absorbed some Swift syntax and gained an overview of Swift and SpriteKit. It is time to make room for our own game; let's clear all of that demo code out! We want to keep a little bit of the boilerplate, but we can delete most of what is inside the functions. To be clear, I do not expect you to understand this code yet. This is simply a necessary step toward the start of our journey.

Firstly, we will remove the Hello, World text from the demo. Open the GameScene.sks file from the project navigator in Xcode. You will see a gray layout view with Hello, World written in the middle. Simply click anywhere on the Hello, World text and press your Delete key to remove it. Make sure you save your file before moving on.

Secondly, please replace all of the code from your GameScene.swift file with the following code:

import SpriteKit

class GameScene: SKScene { 
    override func didMove(to view: SKView) { 
    } 
} 

Once your GameScene.swift file looks like the preceding code, you are ready to move on to Chapter 2, Sprites, Camera, Actions! The real fun begins now!

主站蜘蛛池模板: 汝阳县| 永德县| 青浦区| 绩溪县| 水城县| 镇赉县| 九龙城区| 孝昌县| 华宁县| 三原县| 阜康市| 海兴县| 清水县| 墨玉县| 乌鲁木齐县| 林西县| 西城区| 德阳市| 田阳县| 新郑市| 广丰县| 贵阳市| 桦南县| 若羌县| 东丽区| 广德县| 称多县| 句容市| 武鸣县| 蛟河市| 邵阳市| 巴里| 北海市| 泰来县| 英德市| 泸定县| 兰考县| 望江县| 阜宁县| 海宁市| 凉城县|