Swift Game Programming for Absolute Beginners

Arjan Egges

相關主題

商品描述

Swift Game Programming for Absolute Beginners teaches Apple’s Swift language in the context of four, fun and colorful games. Learn the Swift 2.0 language, and learn to create game apps for iOS at the same time – a double win!

The four games you’ll develop while reading this book are:

  • Painter
  • Tut’s Tomb
  • Penguin Pairs
  • Tick Tick

These four games are casual, arcade-style games representing the aim-and-shoot, casual, puzzle, and platform styles of game play. Professionally developed game assets form part of the book download. You’ll get professionally drawn sprites and imagery that’ll have you proud to show your learning to friends and family.

The approach in Swift Game Programming for Absolute Beginners follows the structure of a game rather than the syntax of a language. You’ll learn to create game worlds, manage game objects and game states, define levels for players to pass through, implement animations based upon realistic physics, and much more. Along the way you’ll learn the language, but always in the context of fun and games.

Swift is Apple’s new programming language introduced in 2014 to replace Objective-C as the main programming language for iOS devices and Mac OS X. Swift is a must learn language for anyone targeting Apple devices, and Swift Game Programming for Absolute Beginners provides the most fun you’ll ever have in stepping over the threshold toward eventual mastery of the language.

What you’ll learn

  • Write applications in possibly the most important new language of the decade
  • Create games to run on Apple devices such as phones and tablets, and desktops too
  • Create and manage game worlds having multiple levels through which players progress
  • React to player input whether from mouse, keyboard, or touch
  • Achieve realistic movement of game objects through applied physics
  • Prepare your games properly for commercial deployment

Who this book is for

Swift Game Programming for Absolute Beginners is for programmers and technology enthusiasts wanting to learn to program and develop applications for Apple devices such as phones and tablets. The book is also for anyone wanting to learn to program in Apple's new language named Swift. No prior knowledge of Swift is assumed. Swift Game Programming for Absolute Beginners teaches the Swift language from scratch in the context of creating a series of fun and colorful games that you'll be proud to develop and show to your friends, neighbors, and colleagues.

Table of Contents

Part I: Getting Started

1. The Swift Language

2. Game Programming Basics

3. Creating a Game World

4. Game Assets

Part II: Painter

5. Knowing What the Player is Doing

6. Reacting to Player Input

7. Basic Game Objects

8. Game Object Types

9. Colors and Collisions

10. Limited Lives

11. Organizing Game Objects

12. Finishing the Painter Game

Part III: Galactic Waste

13. Adapting to Different Devices

14. Game Object Hierarchies

15. Game Physics

16. Game Object Interaction

17. Finishing the Galactic Waste Game

Part IV: Penguin Pairs

18. Sprite Sheets

19. Storing and Recalling Game Data

20. Pairing the Penguins

21. Finishing the Penguin Pairs Game

22. The Main Game Structure

23. Animation

Part V: Tick Tick

24. Platform Game Physics

25. Intelligent Enemies

26. Adding Player Interaction

27. Finishing the Tick Tick Game

商品描述(中文翻譯)

《絕對初學者的 Swift 遊戲程式設計》以四款有趣且色彩繽紛的遊戲為背景,教授蘋果的 Swift 語言。在學習 Swift 2.0 語言的同時,您還可以學習如何創建 iOS 遊戲應用程式,一舉兩得!

在閱讀本書時,您將開發四款遊戲,它們分別是:
- 繪畫家
- 圖坦卡門之墓
- 企鵝配對
- 滴答滴答

這四款遊戲都是休閒、街機風格的遊戲,代表了瞄準射擊、休閒、解謎和平台遊戲風格。專業開發的遊戲資源是本書的一部分,您將獲得專業繪製的精靈和圖像,讓您自豪地展示給朋友和家人看。

《絕對初學者的 Swift 遊戲程式設計》的方法是按照遊戲的結構而不是語言的語法來進行的。您將學習創建遊戲世界、管理遊戲物件和遊戲狀態、定義玩家通過的關卡、根據真實物理實現動畫等等。在這個過程中,您將學習語言,但始終在有趣的遊戲背景下進行。

Swift 是蘋果於2014年推出的新程式語言,用於取代 Objective-C 成為 iOS 設備和 Mac OS X 的主要程式語言。對於任何目標蘋果設備的人來說,Swift 是一門必學的語言,《絕對初學者的 Swift 遊戲程式設計》將帶給您在逐步掌握這門語言的過程中所擁有的最有趣的體驗。

您將學到什麼:
- 使用可能是本十年最重要的新語言編寫應用程式
- 創建可在蘋果設備(如手機、平板電腦)和桌面上運行的遊戲
- 通過多個關卡進行遊戲世界的創建和管理
- 對來自滑鼠、鍵盤或觸控的玩家輸入做出反應
- 通過應用物理學實現遊戲物件的真實運動
- 正確地準備您的遊戲進行商業部署

本書適合對程式設計和科技感興趣的程式設計師和技術愛好者,他們想要學習編寫和開發蘋果設備(如手機、平板電腦)的應用程式。本書也適合任何想要學習蘋果的新語言 Swift 的人。不需要對 Swift 有任何先備知識,《絕對初學者的 Swift 遊戲程式設計》將從頭開始教授 Swift 語言,並在創建一系列有趣且色彩繽紛的遊戲的過程中展示給您的朋友、鄰居和同事看。

目錄:
第一部分:入門
1. Swift 語言
2. 遊戲程式設計基礎
3. 創建遊戲世界
4. 遊戲資源

第二部分:繪畫家
5. 知道玩家在做什麼
6. 對玩家輸入做出反應
7. 基本遊戲物件
8. 遊戲物件類型
9. 顏色和碰撞
10. 有限生命
11. 組織遊戲物件
12. 完成繪畫家遊戲

第三部分:銀河廢料
13. 適應不同設備
14. 遊戲物件層次結構
15. 遊戲物件物理學
16. 遊戲物件互動
17. 完成銀河廢料遊戲

第四部分:企鵝配對
18. 精靈圖集
19. 儲存和檢索遊戲資料
20. 企鵝配對
21. 完成企鵝配對遊戲
22. 主要遊戲結構
23. 動畫