Learn Sprite Kit for iOS Game Development - Leland Long

Learn Sprite Kit for iOS Game Development (eBook)

(Autor)

eBook Download: PDF
2014 | 1st ed.
XIV, 256 Seiten
Apress (Verlag)
978-1-4302-6440-8 (ISBN)
Systemvoraussetzungen
39,58 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
With Learn Sprite Kit for iOS Game Development, you'll discover how easy it is to create 2D games using the new Sprite Kit framework from Apple. You'll find how simple it is to create a scene, add animated sprites, incorporate edges, play sound effects, and create animated particles for special effects. You'll also use touch events to control your sprites, implement the built-in physics engine, handle sprite collisions and contacts, and much more.

To help you in learning how to use all these cool features of Sprite Kit, you'll follow along as we build a complete 2D game for iPhone. By the time you finish the book, you'll have made your own 2D game, and you'll have learned all you need to know to get started on your next masterpiece.



Leland Long?s programming began on a VIC-20 computer (3K of memory). He moved up to the Apple IIe (64K) and then on to the Mac 512K where he began using Microsoft File for an office database solution. Introduced to Filemaker II in the late 80?s he?s used various FileMaker Pro versions ever since. As a hobbyist he?s written a few programs over the years in BASIC and Pascal, but never pursued learning more languages such as C or learning Object-Oriented concepts. The release of the iPhone SDK has changed that! He?s excited to merge iPhone and FileMaker technologies together, resulting in more power and benefit to users. He is currently an in-house FileMaker developer for a non-profit company in South Carolina, where he lives with his wife and two youngest daughters. His oldest daughter and three grandchildren live close enough to keep life entertaining.


With Learn Sprite Kit for iOS Game Development, you'll discover how easy it is to create 2D games using the new Sprite Kit framework from Apple. You'll find how simple it is to create a scene, add animated sprites, incorporate edges, play sound effects, and create animated particles for special effects. You'll also use touch events to control your sprites, implement the built-in physics engine, handle sprite collisions and contacts, and much more.To help you in learning how to use all these cool features of Sprite Kit, you'll follow along as we build a complete 2D game for iPhone. By the time you finish the book, you'll have made your own 2D game, and you'll have learned all you need to know to get started on your next masterpiece.

Leland Long?s programming began on a VIC-20 computer (3K of memory). He moved up to the Apple IIe (64K) and then on to the Mac 512K where he began using Microsoft File for an office database solution. Introduced to Filemaker II in the late 80?s he?s used various FileMaker Pro versions ever since. As a hobbyist he?s written a few programs over the years in BASIC and Pascal, but never pursued learning more languages such as C or learning Object-Oriented concepts. The release of the iPhone SDK has changed that! He?s excited to merge iPhone and FileMaker technologies together, resulting in more power and benefit to users. He is currently an in-house FileMaker developer for a non-profit company in South Carolina, where he lives with his wife and two youngest daughters. His oldest daughter and three grandchildren live close enough to keep life entertaining.

Contents at a Glance 3
Contents 236
About the Author 241
About the TechnicalReviewer 242
Acknowledgments 243
Introduction 4
Chapter 1: Hello World 6
We Love Games 6
Tradition 6
Setup 7
Summary 17
Chapter 2: SKActions and SKTextures: Your First Animated Sprite 18
Humble Beginnings 18
Removing Unnecessary Tidbits 19
Device Orientation 20
Slight View Controller Changes 21
More Unneeded Template Text 21
Images Available for Download 22
Background Color 23
The Splash Screen 23
Anchor Points 24
Back to the Splash Screen 25
Moving Between Scenes 25
Creating a New Scene 26
Animated Transitions Using SKActions 27
Grouping Multiple Actions 29
Animation Frames Using SKTextures 29
Summary 32
Chapter 3: Sprite Movement Responding to User Inputs 33
Run Away! 33
Code Reorganization 35
New Class for the Player 37
Replacing Static Values 40
New Class for Your Textures 41
Adding Textures 43
Changing Direction 45
Skidding to a Stop 48
Summary 52
Chapter 4: Edges, Boundaries, and Ledges 53
Physics 53
Properties of a Physics Body 54
Adding a Backdrop 55
Contacts and Collisions 55
Adding a Brick Base 58
Determining Contact with an Edge 60
Handling Sprite Wrapping 60
Jumping 62
Ledges and Joints 70
Summary 79
Chapter 5: More Animated Sprites: “Enemies” and “Bonuses ” 80
The Opposition 80
Optimizing Texture Generation 82
Enemy “Ratz” Class 83
Timing 87
Wrapping 88
The Update Method 89
Collisions 92
Bonus Coins 97
Enemy and Coin Collisions 103
Summary 104
Chapter 6: Creating a Cast of Characters 105
Static vs. Dynamic Characters 105
File Format 105
XML Format 114
Loading the File 116
Parsing the Data 118
Implementing a New Spawning Process 120
Summary 122
Chapter 7: Points and Scoring 123
What’s the Point? 123
Score Display 123
SKLabelNode 123
Custom Font Textures 124
Status Bar = Off 130
A Different Kind of Score 133
Playing Sound Files 133
CAF Audio Format 133
Player Spawn Sound Effect 134
Player Running Sound Effect 135
Player Jumping Sound Effect 136
Player Skidding Sound Effect 138
Enemy Spawn Sound Effect 140
Coin Spawn Sound Effect 141
Summary 142
Chapter 8: Contacts and Collisions 143
Didn’t You Cover this Already? 143
Contacts vs. Collisions 143
Grates 143
Pipes 145
Enemies that Occasionally Get Stuck 149
Setting the Player’s Starting Location 152
Collecting Coins 153
Coin-Collection Sound Effect 155
Coin Collection Point Display 156
Particle Effects 156
Coin Contact from Below the Ledges 161
Ratz Contact from Below the Ledges 162
Intersection Not Sensitive Enough 166
Base Runners 168
Player Kicking Enemies 169
Ratz Collection Sound Effect 171
Ratz Collection Point Display 172
Kicked Off 172
Into the River 175
Enemies Kill Player 178
Player Death Sound Effect 179
Player Falls Off Ledge 179
Player in the Water 183
Summary 184
Chapter 9: Add More Scenes and Levels 185
Multiple Player Lives 185
Adding a Visual Life Meter 187
Game Over 189
High Score 192
Level-Completion Test 196
Level-Completion Effects 198
Unending Levels 200
A New Enemy Type 203
Two Hits Instead of One 218
Levels Three and Four 221
Player Instructions 223
Summary 225
Chapter 10: Where to Go from Here 226
Going Forward with Sprite Kit 226
Making the Game Better 226
Resources 227
Farewell 227
Index 228

Erscheint lt. Verlag 30.6.2014
Zusatzinfo XIV, 256 p. 62 illus.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Betriebssysteme / Server iOS
Informatik Programmiersprachen / -werkzeuge Mac / Cocoa Programmierung
Informatik Software Entwicklung Spieleprogrammierung
Mathematik / Informatik Informatik Theorie / Studium
ISBN-10 1-4302-6440-3 / 1430264403
ISBN-13 978-1-4302-6440-8 / 9781430264408
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 6,4 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Unlock the world of iOS development with Swift 5.9, Xcode 15, and iOS …

von Ahmad Sahar

eBook Download (2023)
Packt Publishing (Verlag)
32,39
Für Einsteiger ohne Vorkenntnisse

von Daniela Eichlseder; Anja Schmid

eBook Download (2023)
BILDNER Verlag
9,99