Skip to Content
Swift游戏开发经典实例
book

Swift游戏开发经典实例

by Jonathon Manning, Paris Buttfield-Addison
January 2020
Intermediate to advanced
356 pages
6h 4m
Chinese
China Electric Power Press Ltd.
Content preview from Swift游戏开发经典实例
175
6
2D
图形和
Sprite Kit
几乎所有的游戏都在某种程度上使用了
2D
图形。甚至是大部分大型
3D
游戏在某
种程度上也要使用
2D
元素,如在菜单和游戏界面中。
在创建游戏时仅使用
2D
图形元素,是一种保持游戏简单性的好方法。
2D
远比
3D
简单,不论是在游戏操作方面还是在图形方面都更容易制作。例如对于解密游戏,
更容易被设计为
2D
游戏而不是较复杂的
3D
游戏。
2D
图形比较简单的主要原因有:不需要考虑物体如何从多个角度观察物体,也不
需要担心光源,而且创造一个
2D
图片构成的场景比创建一个
3D
版的场景要容易
得多。
iOS
自带了一个用于创建
2D
图形的系统,即
Sprite Kit
Sprite Kit
负责与底层绘图
操作协调,如创建
OpenGL
上下文、管理渲染,这样你就可以将精力集中在和游戏
相关的任务,如将游戏角色显示到屏幕上。
Sprite Kit
iOS7
开始引入,它同时支持
iOS
OS X
系统。
Sprite Kit
在这
两个平台上的
API
是相同的,因此可以轻易将游戏从一个平台迁移到另一个
平台。
本章,我们将学习如何使用
Sprite Kit
来绘制我们的游戏图形。
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精通機器學習

精通機器學習

Aurélien Géron
FreeBSD® Unleashed

FreeBSD® Unleashed

Brian Tiemann, Michael C. Urban
深入淺出代數

深入淺出代數

Tracey Pilone, Dan Pilone
Swift学习手册

Swift学习手册

Jon Manning, Paris Buttfield-Addison, Tim Nugent

Publisher Resources

ISBN: 9787519840129