iPhone 3D Game Programming All In One 1st Edition
Jeremy (Jeremy Alessi) Alessi - PDF Download (2025)
    https://ebookultra.com/download/iphone-3d-game-programming-all-
               in-one-1st-edition-jeremy-jeremy-alessi-alessi/
  Visit ebookultra.com today to download the complete set of
                     ebooks or textbooks
   We believe these products will be a great fit for you. Click
         the link to download now, or visit ebookultra.com
                            to discover even more!
3D Game Programming All in One 2nd ed Edition Finney K C
https://ebookultra.com/download/3d-game-programming-all-in-one-2nd-ed-
edition-finney-k-c/
Beginning iOS Game Development 1st Edition Patrick Alessi
https://ebookultra.com/download/beginning-ios-game-development-1st-
edition-patrick-alessi/
Advanced 3D Game Programming All in One 1st Edition
Kenneth C(Kenneth C. Finney) Finney
https://ebookultra.com/download/advanced-3d-game-programming-all-in-
one-1st-edition-kenneth-ckenneth-c-finney-finney/
Game Programming All in One 1st Edition Bruno Miguel
Teixeira De Sousa
https://ebookultra.com/download/game-programming-all-in-one-1st-
edition-bruno-miguel-teixeira-de-sousa/
iPhone All in One For Dummies 3rd Edition Joe Hutsko
https://ebookultra.com/download/iphone-all-in-one-for-dummies-3rd-
edition-joe-hutsko/
Introduction to 3D Game Programming with DirectX 11 1st
Edition Frank Luna
https://ebookultra.com/download/introduction-to-3d-game-programming-
with-directx-11-1st-edition-frank-luna/
Advanced 3D Game Programming with DirectX 10 0 Wordware
Game and Graphics Library 1st Edition Peter Walsh
https://ebookultra.com/download/advanced-3d-game-programming-with-
directx-10-0-wordware-game-and-graphics-library-1st-edition-peter-
walsh/
CAPM PMP Project Management All in One Exam Guide All in
one 1st Edition Joseph Phillips
https://ebookultra.com/download/capm-pmp-project-management-all-in-
one-exam-guide-all-in-one-1st-edition-joseph-phillips/
Killer Game Programming in Java 1st Edition Andrew Davison
https://ebookultra.com/download/killer-game-programming-in-java-1st-
edition-andrew-davison/
iPhone 3D Game Programming All In One 1st Edition
Jeremy (Jeremy Alessi) Alessi Digital Instant Download
Author(s): Jeremy (Jeremy Alessi) Alessi
ISBN(s): 9781435455962, 1435455967
Edition: 1
File Details: PDF, 16.87 MB
Year: 2010
Language: english
                                                 ‡
        iPhone 3D Game
           Programming
              All in One
                                                                        Jeremy Alessi
                               Course Technology PTR
                                A part of Cengage Learning
Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
    iPhone‡ 3D Game Programming          † 2011 Course Technology, a part of Cengage Learning.
    All in One
                                         ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may
    Jeremy Alessi                        be reproduced, transmitted, stored, or used in any form or by any means graphic,
                                         electronic, or mechanical, including but not limited to photocopying, recording,
    Publisher and General Manager,
                                         scanning, digitizing, taping, Web distribution, information networks, or information
      Course Technology PTR:
                                         storage and retrieval systems, except as permitted under Section 107 or 108 of the
      Stacy L. Hiquet
                                         1976 United States Copyright Act, without the prior written permission of the
    Associate Director of Marketing:     publisher.
      Sarah Panella
    Manager of Editorial Services:                For product information and technology assistance, contact us at
     Heather Talbot                              Cengage Learning Customer & Sales Support, 1-800-354-9706
    Marketing Manager: Jordan                 For permission to use material from this text or product, submit all requests
     Castellani                                                 online at cengage.com/permissions
                                                           Further permissions questions can be emailed to
    Senior Acquisitions Editor:
                                                                 permissionrequest@cengage.com
      Emi Smith
    Project Editor: Marta Justak
                                         Apple, iTunes, iPhone, iPod Touch, and Xcode are registered trademarks
    Technical Reviewer:
                                         of Apple Inc. 3D Studio Max and Mudbox are registered trademarks of
      Michelle Menard
                                         Autodesk Inc. PhysX is a registered trademark of NVIDIA Corporation.
    Copy Editor: Gene Redding
                                         Windows is a registered trademark of Microsoft Corporation. Photoshop
    Interior Layout Tech: MPS Limited,   is a registered trademark of Adobe Systems Incorporated. Wii Sports Resort
       A Macmillan Company               is a registered trademark of Nintendo. Google and Google Earth are
    Cover Designer: Matt Donlan          registered trademarks of Google. All other trademarks are the property
    Cover Producer: Mike Tanamachi       of their respective owners.
    CD-ROM Producer: Brandon             All images † Cengage Learning unless otherwise noted.
     Penticuff
    Indexer: Kelly Talbot                Library of Congress Control Number: 2009942391
    Proofreader: Michael Beady           ISBN-13: 978-1-4354-5478-1
                                         ISBN-10: 1-4354-5478-2
                                         eISBN-10:1-4354-5596-7
                                         Course Technology, a part of Cengage Learning
                                         20 Channel Center Street
                                         Boston, MA 02210
                                         USA
                                         Cengage Learning is a leading provider of customized learning solutions
                                         with office locations around the globe, including Singapore, the United
                                         Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at:
                                         international.cengage.com/region
                                         Cengage Learning products are represented in Canada by Nelson
                                         Education, Ltd.
                                         For your lifelong learning solutions, visit courseptr.com
                                         Visit our corporate website at cengage.com
Printed in the United States of America
1 2 3 4 5 6 7 12 11 10
  This book is dedicated to my mother, my father, and my wife. Mom, thanks for
always believing in me. Life’s not the same without you. Dad, thanks for teaching me
the value of hard work by making me lift those five-gallon buckets when I was three
years old. Finally, thank you, Hilary, for putting up with all the late nights and long
 hours that go into game development. Your love and support are mind-boggling!
Acknowledgments
I would like to thank all of my friends and family who helped me along the
broken road of game development. In no particular order, thanks to Kacey,
Luke, Evan, Stephanie, Frank, Joe, Kerri, Greg, Ease, John, Stacey, Steve, Jeremy,
Chris, Match, Michael, Emily, Nick, Rich, and Leroy. You all listened when I
needed an ear and played when I needed a spare set of thumbs.
I would also like to thank all the folks at Unity Technologies. David Helgason
and Joachim Ante, I’m your biggest fan! Thank you for believing in my writing
and trusting me with your engine. Unity3D is a masterpiece of game develop-
ment technology—thanks for empowering my imagination.
Of course, we wouldn’t have a book at all if it weren’t for all the great people
involved. Thank you, Marta Justak—you are just plain awesome. This book
never would have come together without your calls (phone or otherwise). Thank
you, Michelle Menard, for staying sane and keeping me logically honest. Thank
you, Gene Redding, for whipping the book into shape and for really doing your
homework on the subject at hand. Thank you, Brandon Penticuff, for getting all
that data on the CD (it fit, right?). Thanks a million, Matt Donlan, for creating
beautiful cover art at a moment’s notice. Finally, thanks, Emi Smith, for giving
me the chance to write about making iPhone games in the first place; it’s not
often that a person gets to partake in a passion on this level. I appreciate it to the
fullest.
iv
                                                                Acknowledgments        v
I also need to thank some industry folks. Thanks to Brenda Brathwaite for talk-
ing to me about Skyline Riders at Dave and Busters in Bethesda, Maryland, way
back in early 2002. In some ways, that was the beginning of my professional game
development career. Thank go to Jeff Tunnell for guiding me through the de-
velopment of my first published game, Aerial Antics. Without the indie move-
ment, I don’t know where the industry would be today. Thanks to Adrian Tysoe
for taking a shot with me on Aerial Antics. The visuals still stand strong today.
We made a killer game (even if the music sucks). Thanks to the Gamasutra guys,
Simon Carless and Christian Nutt, for all the help with the Games Demystified
series and beyond. Thank you Mario and GLaDOS, without gravity and portals,
this book would not be possible. Thank you Ori Cohen for helping me produce
Skyline Blade. When that game hit the App Store, I finally saw the light at the end
of the tunnel. Thank you Fraser McInnes at Pocket Gamer for making me realize
just how much more of the tunnel I have left to traverse before I reach the light.
Thank you Rich Smith, you worked alongside me during the hardest time of my
life, and that office was depressing without you. Finally, thank you to all the
players for downloading the heck out of Crash For Cash. You answered a prayer
of mine by taking the game all the way to a #1-ranked position. It’s hard to feel
down about anything when your game has been played nearly two million times.
In addition, I’d like to thank my new family-in-laws. The past year has been
tough, and there’s no rest for the weary. Luckily, there was a lot of laughter, good
company, and good food (always good food). I’m a family person and without
you all I would have been awfully lonely this year. I cannot possibly thank you
enough for all that you’ve done!
Lastly, thanks Apple for developing a revolutionary gaming platform to write
about. I can’t wait to see what’s next!
About the Author
Jeremy Alessi has been developing video games for over a decade. Scholastic,
Garage Games, and Reflexive Entertainment have published his work. His first
independent title, Aerial Antics (2004), was nominated for Sim Game of the Year
by Game Tunnel, was listed as a top-five physics download by Computer Gam-
ing World, and was featured on the G4 Network TV show Cinematech. Jeremy
has produced numerous titles for the iPhone through independent studio Mid-
night Status. Several of his iPhone titles have held top 100 positions in the App
Store, including Crash For Cash, a #1-ranked title that has been played nearly two
million times. Jeremy is also a freelance tech writer, having created the popular
Games Demystified series of articles that appear on Gamasutra. Last, but not
least, Jeremy works part-time programming serious games for L3 Communica-
tions, the sixth largest defense contractor in the United States.
vi
Contents
            Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
PART I      SOME ASSEMBLY REQUIRED . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1   Ready, Fire, Aim! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
            Calculating a Trajectory for the Journey . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
            It’s Not the Size of the Game, It’s the Motion of the Air-to-Surface
            Missiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
            A Long Time Ago (Like a Millisecond), Far, Far Away . . . . . . . . . . . . . . . . 9
            What’s a Vector, Victor?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
            Talk the Talk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
            Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 2   Apple’s Ring, Apple’s Ropes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
            $99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   18
            A Quick Look at iTunes Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        18
            iPhone SDK and Xcode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   19
            OS X and iTunes Software Upgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                             20
            Find Your Device Identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   20
            Adding Devices Using the iPhone Developer Program Portal. . . . . . . . .                                               20
            Creating an iPhone Developer Certificate . . . . . . . . . . . . . . . . . . . . . . . . .                              21
            Uploading a Certificate Signing Request. . . . . . . . . . . . . . . . . . . . . . . . . .                              22
                                                                                                                                    vii
viii   Contents
                   Approving a Certificate Signing Request. . . . . . . . . . . . . . . . . . . . . . . . . .                              22
                   Downloading and Installing Development Certificates. . . . . . . . . . . . . .                                          23
                   Creating an App ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              23
                   Creating a Development Provisioning Profile. . . . . . . . . . . . . . . . . . . . . .                                  24
                   Installing Provisioning Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    25
                   Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        26
       Chapter 3   Unity Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
                   And Now a Demonstration of This Fully Armed and Operational
                   Game Development Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     27
                   Main Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           42
                      File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   42
                      Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   43
                      Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     57
                      GameObject. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            59
                      Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            61
                   Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       61
                      Transform Component Inspector Menu. . . . . . . . . . . . . . . . . . . . . . . . .                                  63
                      Mesh Component Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                              63
                      Collider Component Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . .                              65
                      Box Collider Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                      66
                      Sphere Collider Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                         69
                      Capsule Collider Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                          69
                      Mesh Collider Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                         72
                      Wheel Collider Inspector Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                          74
                      Raycast Collider Inspector Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                         80
                   Additional Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     82
                   Scene View Submenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  82
                   Game View Submenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   87
                   Hierarchy View Submenu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     89
                   Project View Submenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  90
                   Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        98
       Chapter 4   Creating the Perfect Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
                   Out with the Old, in with the New . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                       104
                   Creating Complex iPhone Experiences. . . . . . . . . . . . . . . . . . . . . . . . . . .                            106
                   What Will We Create? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                108
                   The Devil’s in the Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              110
                   iPhone Tailored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         111
                                                                                                                   Contents          ix
            Name That Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
            Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
PART II     GAME MAKIN’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Chapter 5   The Strengths and Weaknesses of the iPhone’s Unique
            Input Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
            Out with the Old, Input with the New. . . . . . . . . . . . . . . . . . . . . . . . . . .                          123
            Unity Remote. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        125
            Touch and Tilt Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           127
            iPhoneInput Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          127
            iPhone Input Code Samples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   128
            The Accelerometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            137
            Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     142
Chapter 6   Concept Art. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
            Research in Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
            Owning Your Creative Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
            Going Digital . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
              2D Digital Pre-School . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
              Research in Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
            Sometimes You Have to Sketch Before You Can Run . . . . . . . . . . . . . . 151
              2D Digital . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
            3D Digital Concept Art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
            Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Chapter 7   Prototyping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
            Preconceived Notions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             213
            Version 0.01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     214
            Logical Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       214
            Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   232
            Version 0.02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     241
            Code Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       247
            Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     251
Chapter 8   Play Testing and Iterating. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
            Testing Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
            Prepping the Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
            Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
x   Contents
    Chapter 9              Production Art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
                           Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
    Chapter 10             Tying Up Loose Ends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
                           Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
    Chapter 11             Shipping and Handling Extra . . . . . . . . . . . . . . . . . . . . . . . . . . 391
                           Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
    Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Introduction
The iPhone platform is the newest and most revolutionary game platform in
existence today. Developers, both large and small, are finding critical and
financial success while game players are now able to have fun with more experi-
ences for less money than ever before. This book focuses on 3D game development
for the iPhone and iPod Touch utilizing Unity (unity3d.com). Unity is an ex-
cellent tool capable of PC, Mac, Xbox 360, and Wii development, as well as iPhone
and iPod Touch deployment. Unity can be acquired free via the ‘‘indie’’ version,
although more experienced users may want to opt for the advanced version of
Unity to unlock professional-level features.
Aside from covering Unity, this book will cover certain aspects of Xcode, concept
art, basic 3D modeling, math, physics, game prototyping, and the business
aspects to help you become successful on the App Store. Creating games isn’t just
a technical challenge. Smart design, clever marketing, and a clear understanding
of the business can make or break a game just as easily as a poor algorithm or
unattractive visuals.
There has never been a better time to jump into game development. The tools are
great, the market is hot, and the iPhone technology represents the cutting edge of
the game industry on many fronts. Never before has such great technology been
so widely accessible. In the past, the best technology and development tools were
reserved for large publishers with deep pockets. Now it’s possible for an
                                                                                xi
xii   Introduction
      independent game developer to emerge on top, armed with the best tools the
      industry has to offer. Let’s get started!
      What You’ll Find in This Book
      This book covers the creation of Tropical Tailspin (a casual flight simulator for
      the iPhone) from conception to completion as a published product on the App
      Store. The development process begins with a high-level analysis to determine
      what game to make. Once the game concept is determined, the iPhone hardware
      is examined to figure out the best way to support the game concept with the
      iPhone’s unique interface. From there, the book covers the creation of concept
      art, game prototyping, testing, and final production. The book ends with Tropi-
      cal Tailspin uploaded to the App Store.
      Who This Book Is For
      This book is for novices and intermediate developers who want to learn about
      iPhone development. The book covers game development fundamentals, includ-
      ing programming principals, 2D image editing, 3D modeling, and more advanced
      3D programming. The more complex aspects include the fixed-wing flight physics
      and the crunch associated with the delivery of the game to the App Store.
      How This Book Is Organized
      The book is divided into two parts, ‘‘Some Assembly Required’’ and ‘‘Game
      Makin’.’’ The first part of the book focuses on the preparation required to begin
      developing a game, covering the tools in terms of both hardware and software
      development for iPhone games. The second part of the book covers the actual
      creative and engineering process necessary to create and ship a game.
      Part I: Some Assembly Required
        ■   Ready, Fire, Aim! covers the basics from the iPhone hardware to general
            programming. In this chapter, you’ll learn about the hardware needed to
            test applications and the subtle differences between each revision released by
            Apple. Beyond the hardware, the first chapter highlights the software
            packages and general programming skills necessary to create a game.
        ■   Apple’s Ring, Apple’s Ropes explores the boundaries Apple has created for
            developers to operate within and explains the registration, certificate, and
                                                                Part II: Game Makin’    xiii
     provisioning processes involved in creating an iPhone game. By the
     completion of this chapter, you’ll be a registered iPhone developer ready to
     dive into Unity and begin developing that dream game.
 ■   Unity Fundamentals dissects the Unity iPhone interface. You’ll learn about
     the Unity Editor’s general functionality. You’ll create a Unity 3D scene that
     could be deployed to the iPhone.
 ■   Creating the Perfect Concept sets the stage for the creative endeavor that is
     involved in game development. In this chapter, you’ll determine through
     logical analysis exactly what game you’re going to develop. We’ll lay out the
     groundwork for Tropical Tailspin, a game that will be released on the App
     Store.
Part II: Game Makin’
 ■   The Strengths and Weaknesses of the iPhone’s Unique Input Interface
     starts you on the journey of actually implementing your game. You’ll learn
     about the code behind the most basic ways a player might interact with a
     game on the iPhone. You’ll cover basic touch gestures, some graphics
     principles in 3D and 2D, and finally the use and calibration of the iPhone’s
     accelerometer.
 ■   Concept Art is the chapter in which we’ll begin creating the imagery
     associated with Tropical Tailspin. This chapter covers both technical and
     design-oriented aspects of the basic art an iPhone game needs. We’ll create
     concept sketches, a game icon, and the first 3D scene directly related to
     the Tropical Tailspin project.
 ■   Prototyping builds on the 3D scene created at the end of Chapter 6. This
     chapter extends into the basic flight mechanics that will power the example
     game. By the end, we’ll test our new mechanics in a playable fashion utiliz-
     ing Unity Remote, a special tool that comes with Unity 3D and helps quickly
     run and debug the game over a network.
 ■   Play Testing and Iterating covers the process of letting third parties test
     your game, offering feedback along the way. With the newly acquired input,
     we’ll take our example game to the next level by changing our code, design,
     and art. By the end of this chapter, we will either have fixed all of our game’s
xiv   Introduction
            major issues or at least know what the major issues are that need to be
            addressed.
        ■   Production Art is the art that our game will ship with. In this chapter, we’ll
            ditch the clumsy concept art and create art worthy of a download in the
            highly competitive environment that is the App Store. We’ll model and
            texture an island chain, acquire, rig, and animate a seaplane, and set up our
            final scene in Unity including lights, skybox, and detail scenery.
        ■   Tying Up Loose Ends is a rough and wild ride. This chapter covers the
            crunch period in which many rapid solutions are developed in order to
            deliver Tropical Tailspin. By the end of this chapter, we’ll have created a fully
            functional game and covered many new technical solutions to the problems
            encountered along the way.
        ■   Shipping and Handling Extra takes us beyond the development of Tropical
            Tailspin and onto the process of packaging the game for delivery to Apple.
            This chapter describes Xcode and the iTunes Connect Web site. By the
            completion of this chapter, Tropical Tailspin will be waiting in line for
            approval by Apple and be just one step away from players’ hands.
      About the CD-ROM
      The iPhone 3D Game Programming All in One CD comes packed with the simple
      code samples that appear in Chapters 1-5, the full Tropical Tailspin game package,
      the seaplane model donated for educational use by Tomáš Dřı́novský, a variety of
      media resources, and the Unity3D trial software. To use the Tropical Tailspin
      and sample code (also referred to in the text as the iPhone3DGamePro-
      grammingAllinOne project), simply create a new Unity project and then right-click
      in the Project View and use the Import Package option. Good luck!
      CD-ROM Downloads
      If you purchased an ebook version of this book, and the book had a companion
      CD-ROM, we will mail you a copy of the disc. Please send ptrsupplements
      @cengage.com the title of the book, the ISBN, your name, address, and phone
      number. Thank you.
       part 1
Some Assembly
Required
Creating iPhone games is a technical challenge. There are some fundamental
aspects that you must think about before diving headfirst into a complex game
project. First, you must have the proper hardware and software in place. In
addition, there’s a certain degree of math knowledge required. Creating a 3D
game isn’t a simple task, and it requires at least basic algebra skills. This book will
cover the 3D math and physics necessary to make your game come alive from a
top-down perspective. What this means is that we’ll look at gameplay first and
then move down, showing you how it is built. This method will help readers who
aren’t math savvy become just that.
Finally, beyond math and physics, we’ll be learning how to program. Unity
allows users to write code in C#, Boo (Python), and JavaScript. The reasons for
providing three programming options are numerous. Chief among them is that
different people have different tastes when it comes to programming syntax.
Some users want a simpler interface even if it limits them, and some prefer a
more complex interface because they are advanced users. In general, JavaScript is
the language of choice among Unity users and within the Unity documentation.
                                                                                     1
2   Part 1   ■   Some Assembly Required
    This book will focus on JavaScript, which provides the simplest interface
    with Unity. One thing to note is that Unity is based on the Mono Project
    (www.mono-project.com). This means that Unity’s specialized functionality is
    covered within Unity documentation, but its base functionality (such as string
    handling) is documented on the Mono Project Web site. For this reason, some-
    times JavaScript calls can be excessively long if they reference a method deep
    within the Mono Project’s code base. If the same code were written with C#, then
    a simple ‘‘using’’ call would be made at the top of the script so that long nested
    class calls could be avoided.
   chapter 1
Ready, Fire, Aim!
Before we delve into the depths of iPhone development, there are a few things
you’ll need. First and foremost, it’s important to have an iPhone or iPod Touch
to develop and test your games on. There are various revisions of each device on
the market, and it’s important to know the differences before developing
your game.
The iPhone has three incarnations. The original iPhone that was released in
2007, the iPhone 3G, released during the summer of 2008, and the iPhone 3GS,
released in June 2009. The original and 3G versions are pretty similar in terms of
performance. The iPhone 3G is slightly but not noticeably quicker. The biggest
difference between the two phones is the inclusion of GPS (global positioning
system) in the iPhone 3G. If your game idea revolves around GPS, then you may
have to exclude original iPhone owners.
The iPhone 3GS is a whole new ball game in terms of performance. The 3GS
model is four times faster than the iPhone 3G and includes a new graphics chip,
called the PowerVR SGX. This chip replaces the PowerVR MBX Lite included
with the older iPhones. This new chip supports OpenGL ES 2.0, so not only will
the iPhone 3GS outperform the frame rates of the older iPhones, but it can also
handle next-generation shader effects.
The iPod also has three incarnations that offer similar gaming performance to
their iPhone cousins, with a few exceptions, which should be taken into account
when developing a game. The first-generation iPod, iPhone, and iPhone 3G all
                                                                                3
4   Chapter 1     ■   Ready, Fire, Aim!
    contain the Samsung ARM 1176JZ(F)-S v1.0 processor. The second-generation
    iPod contains an updated version of this processor, called the ARM 1176 v4.0.
    The original devices containing the v1.0 processor were all underclocked from
    620MHz to 412MHz. The second-generation iPod Touch not only features an
    updated version of the ARM 1176 processor, but in addition it is clocked to
    533MHz. This small update drastically improved the performance of the second-
    generation iPod Touch relative to the original hardware.
    Figures 1.1 and 1.2 show the iPhone and iPod Touch, respectively. Cosmetically,
    they are almost identical, but there are a few differences. The iPod Touch is
    significantly thinner than the iPhone (0.46 inches for the original iPhone, 0.48
    inches for the 3G/3GS, and 0.33 inches for the iPod Touch). Secondly, the
    volume and lock buttons on the iPod Touch are black plastic instead of metallic.
    In addition, the lock button is on the top right of the iPhone and on the top left
    of the iPod Touch. Finally, the speaker jack of the iPhone is located adjacent to
    the lock button, whereas it is next to the power input plug of the iPod Touch on
    the bottom of the device.
    It’s hugely important to test your games on multiple devices unless you are
    specifically targeting just one. In that case, it’s possible to limit an application to
    Figure 1.1                                     Figure 1.2
    The iPhone.                                    The iPod Touch.
                                                                                 Ready, Fire, Aim!       5
being downloaded only to a supported device via iTunes Connect, which we’ll
cover in depth later.
The final hardware variances are the inclusion of a camera on both of the
iPhones, the exclusion of any sort of microphone on both iPods, and
the exclusion of a speaker from the first-generation iPod Touch. These hardware
variances are fairly subtle and do not affect most games. However, it is important
that you pick the right device if you’re developing a specialized game. Beyond
that, it’s also very helpful to test your game on multiple devices to consider the
performance and tactile feedback differences caused by the subtle hardware up-
grades Apple has executed over the lifetime of the platform. Here is a descending
list of iPhone/iTouch hardware from most to least powerful.
  ■    iPhone 3GS
  ■    iPod Touch third generation
  ■    iPod Touch second generation
  ■    iPhone 3G
  ■    iPhone
  ■    iPod Touch first generation
With the various hardware configurations out of the way and with an i-Device in
hand, it’s time to pick up a development machine. The cheapest way to jump
into iPhone development is with an Intel-based Mac Mini equipped with OS X
Leopard ($599). It’s important to note that older versions of OS X– and Power
PC– (PPC) based Macs cannot be used for iPhone development. Whichever Mac
you choose for development, make sure that it’s equipped with OS X Leopard
and an Intel-based processor. While there are some hacks available to develop
using PPC processors, they will only carry you so far. It’s best to begin with
the proper tools if you’re serious about developing and delivering a great
iPhone game.
Note
      A three-button mouse is also highly recommended. Without one, Unity’s interface is not nearly as
      easy to navigate. Step 1 to streamlining Unity’s interface is getting a three-button mouse.
Other documents randomly have
       different content
    The total mortality of this pestilence in Milan has been estimated
roughly at 150,000 persons. The Sanità, or Board of Health, profiting
by the lessons of the previous plague, seem to have acted with
sense and energy, though hampered by the ignorant obstinacy of
the Senate, the Council of Decurions, and the Magistrates, who were
afraid of driving away trade, if the presence of plague were
admitted. One strange remedial measure was the organization of an
immense procession through the streets in honour of San Carlo.
During the procession all the sequestered houses were fastened up
with nails to prevent the infected inmates from joining in it. Deaths
were so numerous at the height of the plague that the burial-pits
were filled, and bodies lay putrefying in the houses and streets. The
Sanità sought the help of two priests, who undertook to dispose of
all the corpses in four days. With the assistance of peasants, whom
they summoned from the country in the name of religion, three
immense pits were dug. The Sanità employed monatti to bring out
the dead and cart them to the pits, and the priests accomplished
their task within the appointed time. Besides the monatti they
appointed apparitores, or summoners, who went in advance of the
monatti ringing a bell to warn the people to bring out their dead.
Commissari supervised both apparitores and monatti. Piazza was
one of these overseers.
   The plagues of the seventeenth century have left behind them
very many memorials both in literature and in art: among them the
great plague of Milan is only one of many.
     Southern France was attacked again and again, and in 1643
plague raged fiercely at Lyons. Over the portico of the church of
Notre-Dame de Fourvière, which stands high up on the precipitous
hill that overhangs the town, is a frieze commemorating this plague.
   In Italy, city after city succumbed. Guido’s picture, ‘Il Pallione del
Voto,’ reminds us that Bologna suffered along with Milan. Venice
suffered too, and out of her ruin rose the church of S. Maria della
Salute.
    Florence retains in the Bargello a hideous reminiscence of her
visitation in a wax representation of ‘Pestilenza’ by Zumbo Gaetano
Giulio (1656-1701). Corpses are lying about in various stages of
decomposition: among them lies a dead mother beside her infant
child. A man, whose nostrils are covered with a bandage, attempts
to carry away a corpse. In the background great bonfires are
burning. The modelling of the carcases is anatomically exact, but the
production as a whole is utterly repulsive.
    In 1656 Naples assumes the leading rôle in this hideous Dance of
Death. Soldiers brought the plague on a transport from Sardinia. At
first the viceroy attempted to disguise the true character of the
disease. The first doctor who dared to pronounce the sickness
plague was promptly put in prison. Malcontents spread the report
that the Spaniards had designedly introduced the plague, and were
employing people to go through the city in disguise, sowing
broadcast poisoned dust. The infuriated populace turned on the
Spanish soldiery, who sought safety by transferring the accusation to
the French. Nothing but blood would satisfy the mob, and Angelucci
di Tivoli, reputed author of the plague powder, was broken on the
wheel as a peace-offering to their bloodt-hirsty fury. The Spaniards
were accused also of poisoning the holy water in the churches by
means of the deadly powder. Superstition was rampant in every
form. One said that he had been miraculously cured by drinking holy
water before an image of the Virgin. Another saw a marble statue of
the Madonna and Child in the church of S. Severo covered with
sweat, and the faces of both livid and marked by the plague. A
doctor, Francesco Mosca, who printed a formula for curing the
plague, was honourably entitled Protomedico. A nun prophesied that
the building of a convent on the hill of St. Martin for her sisterhood
would bring to an end the pestilence. The building was taken in
hand in eager haste, rich and poor vying in bodily labour, but in spite
of all their efforts the mortality grew apace. By a strange perversity
of reasoning penitential processions paraded both day and night the
very streets in which priests, in terror of the contagion, were
administering the Sacrament on the end of a stick. The death-roll of
six months was 400,000 lives. Various writers have described this
plague, among them Muratori, Giannone, and de Renzi in his Naples
in the year 1656, published in 1667. The Papal Nuncio in Naples at
the time thought fit to write a pamphlet on it, and of modern writers
Shorthouse has made poor use of it in his John Inglesant.
    Micco Spadara (1612-79), who actually witnessed this plague,
has left a picture of it, which is now in the National Museum at
Naples. It represents the Piazza Mercatello, a veritable
pandemonium of dead and dying. Monatti, drawn from the galley-
slaves, are dragging the corpses with hooks to carts in which to
carry them to the burial-pits. Here and there sedan chairs are seen.
These were used to carry the sick to the lazarettos. At first chair-
bearers were selected from the citizens who volunteered for the
task, but when all these were dead, galley-slaves and convicts took
their place. In the plague of Marseilles in 1720 sedans were put at
the disposal of the doctors, ‘for their more easy conveyance
everywhere’, by order of the Town Council.
    There was plague in Rome as well as Naples in 1656. Nicolas
Poussin (1594-1665) was resident in Rome, and has left the
testimony of an eye-witness in his picture, ‘The Plague of Rome,’
now in the Czernin Collection at Vienna. It is a landscape with
architectural features, of which Denio[179] gives this brief notice:
‘Two men are seen dragging a corpse to the mouth of a vault, whose
opening is already barred by dead bodies. A man, enveloped in a
white mantle, directs the bearers where to go: by his side is a
jackal-like dog. On the high platform of the receptacle we notice a
group of six men. Broken columns take the place of the half-seen
trees in other works, while sarcophagi and tombs indicate a
cemetery. Beyond the arch stretches the Campagna.’ Poussin has
introduced into the picture the Castle of S. Angelo, mindful, no
doubt, of the legend of Gregory’s vision.
        PLATE XXVI PLAGUE OF NAPLES, 1656.
                     BY MICCO SPADARA
            Photograph by Brogi, Florence    (Face Page 184)
    The church of Santa Maria in Campitelli at Rome was rebuilt, in
its present form, in 1659, by Carlo Rainaldi, to accommodate a
miraculous image of the Virgin, to which the cessation of the plague
of 1656 was ascribed. The church is sometimes called S. Maria in
Portico, because of the neighbouring Portico of Octavia. The
miraculous Madonna is placed now beneath the canopy over the
high altar. It is still believed to protect Rome from the contagion of
pestilence. Here, too, came constantly the Elder Pretender and his
son Henry, who took his Cardinal’s title from this church, to offer
prayers to this self-same image of the Madonna, for the liberation of
England from the plague of Protestant apostasy. To this end James
instituted in perpetuity an office of prayer, and ordained that every
Saturday Mass should be said at 11 of the morning before the
picture, with the Sacrament exposed, and that after recital of the
prayers a blessing should be given along with the Sacrament. This
ceremony has ever since been regularly performed.
    In the sacristy is a framed engraving of the miraculous Madonna,
dated 1747. It is surrounded by a series of small pictures, one of
which shows the appearance of the image to S. Galla in the
pontificate of John I (523-6), as she ministered to the wants of
twelve poor men in her house. Another shows Pope John dedicating
the miraculous picture in the oratory of S. Galla, which was
transformed later into the church of S. Maria in Campitelli. The
remaining pictures represent scenes in successive pontificates, in
which this miraculous Madonna brought about a cessation of plague.
A brief explanation in Latin is attached to each.
   The plague of 1656 occurred in the pontificate of Alexander VII.
This Pope did much to atone for the craven spirit of his papal
predecessors by his courage and devotion to his people throughout
the epidemic. It is surprising that no memorial has been erected to
commemorate his services.
    Two rare contemporary prints represent scenes in the course of
this visitation. One is figured by Lanciani in his Golden Days of the
Renaissance:[180] the other is reproduced here.[181] Both were to be
seen in the Medical Exhibition in the Castel S. Angelo in the spring of
1912. Lanciani’s print shows the following scenes:
          1. Inspection of the city gates by Prince Chigi.
           2. Barge-loads of corpses from the lazaretto on the
       island of S. Bartolommeo.
           3-5. Various methods of fighting the plague in
       infected districts.
         6. The ‘Field of Death’ near St. Paul-outside-the-
       Walls.
    The second print is of even greater interest than this: the first
two rows of plates give some idea of the character of the lazarettos,
and show how they were guarded by palisades and sentries: they
also show the carts for transport of the sick attended by armed
soldiers. The disinfection of the books and personal ornaments of
the sick, a dead dog being dragged away to be thrown into the river,
and a sick-cart marked with a cross, are other details of interest. The
third row indicates the removal of infected goods to places outside
the city, where they were either washed or cleansed; places where
other things were deposited; a country residence of the Popes
converted into a convalescent home; and the ruined palace of the
Antonines, where woollen goods were taken for disinfection. The
fourth row represents chiefly wash-houses and washing-places, to
which clothes and bedding were removed for cleansing. The fifth
row, the execution of those who transgressed the sanitary
regulations, the shooting of sick criminals, and the various measures
taken to restrict the river traffic. A cable is thrown across the river,
and palisades are erected on the shores, so as to break all contact
between the city and boats bringing in provisions. The huts are
shown, in which soldiers and officials were lodged, whose duty it
was to compel obedience to the prescribed regulations.
PLATE XXVII PLAGUE SCENES IN ROME, 1656
       From an old engraving   (Face Page 186)
                     CHAPTER XII
   The Great Plague of London, which reached its height in 1665,
has left an abundant aftermath both in literature and art. The main
story of its ravages is too well known to call for repetition.
    There were still some ready to see in the plague, as they were in
the case of the fire, evidence of the handiwork of malevolent Jews.
Since their expulsion from England by Edward I, the Jews had never
yet obtained the legal right of re-entry, their open petition to
Cromwell having failed. With the restoration of Charles II to the
throne, they seem to have taken the matter into their own hands
and found their way quietly back, so that at the time of the plague
there were many resident in London, to the great advantage of trade
and to the relief of an ever-needy Government. But three centuries
of plague, punctuated by fierce outbreaks at regularly recurring
intervals, had served to unravel much of the mystery of pestilence,
and the people had learnt that it was not to be exorcised by a
holocaust of Jews, or by the brutal murder of imaginary poisoners.
    Celestial portents were not lacking to presage the plague. A
blazing comet appeared for several months before the plague. Men
affected to see, in its dull colour and slow solemn movement, a
prediction of the heavy punishment of pestilence; whereas that
which preceded the fire was swift and flaming and foretold a rapid
retribution.
    Superstition raked up images afresh from the scrap-heap of
discarded fancies. Women saw flaming swords in the heavens, some
even saw angels brandishing them over their heads. Astrologers had
strange tales of malignant conjunctions of the planets. Medical
opinion was still divided along the same lines of cleavage, as it had
been for 2,000 years before. There were those who referred the
disease to some occult poison, and those who referred it to an
excess of some manifest quality, such as heat, or cold, or moisture,
in each case corrupting the body humours. Speculation was rife as
to the nature of the causal poison. Some, as Lucretius had done,
conceived it to be pestiferous corpuscles of atomic character, outside
the range of human vision, generated either in the heavens by a
malignant conjunction of planets, or in the soil, and so often
liberated by the agency of earthquakes. These poisons, however
generated, found their way into the human body through the
medium of the distempered atmosphere.
    Some had noticed an unusual absence of birds before the
epidemic, as Thucydides and Livy had done in their times. Boyle
observed a great diminution of flies in 1665, Boghurst a
superabundance of flies and ants in 1664. Sir George Ent and others
attributed the disease to minute invisible insects, but Blackmore
conceived these to be rather a consequence than a cause.
   Insects, so-called, had been vaguely associated with pestilence
from remote antiquity, more especially flies, lice, and locusts; but in
the medical literature of the sixteenth century and after they are
assigned a much more definite role. Mercurialis[182] states that huge
numbers of caterpillars paraded the streets of Venice during the
plague of 1576. Goclenus[183] mentions swarms of spiders during
the plague of Hesse in 1612, and Hildanus swarms of flies and
caterpillars this same year in plague-stricken Lausanne. Bacon
speaks of flies and locusts, as characteristic of pestilential years, and
Diemerbroeck[184] of flies, gnats, butterflies, beetles, grasshoppers,
and hornets in the same connexion. Gottwald[185] reported the
presence of multitudes of spiders during the plague of Dantzig in
1709. Arabian physicians considered the putrefaction of swarms of
dead locusts an important cause of pestilence. Hancock,[186] as late
as 1821, argued that locusts caused famine by destroying the crops,
and so prepared the way for human pestilence.
  Talismans, amulets, reliquaries, and all the stock-in-trade of
magic were in brisk demand among the populace. Quack vendors of
antipestilential remedies innumerable effectively replaced physicians,
most of whom took refuge in flight. All honour to those who stood
fast at their posts and reclaimed for medicine what Galen had
renounced, the captaincy of its own soul. These are the men who
had no fear for ‘the pestilence that walketh in darkness or the arrow
that flieth by day’:
  1.   Dr. Francis Glisson          Presidents of the Royal College
  2.   Sir Thomas Witherley              of Physicians.
  3.   Dr. Nicholas Davys
  4.   Dr. Edward Deantry
  5.   Dr. Thomas Allen
  6.   Sir John Baber
  7.   Dr. Peter Barwick
  8.   Dr. Humphrey Brooks          Fellows of the Royal College
  9.   Dr. Alexander Burnett             of Physicians.
 10.   Dr. Elisha Coysh
 11.   Dr. John Glover
 12.   Dr. Nathaniel Hodges
 13.   Dr. Nathan Paget
 14.   Dr. Thomas Wharton
 15.   Dr. William Conyers     Member of the Royal College
                                    of Physicians.
 16.   Dr. O’Dowd
 17.   Dr. Samuel Peck
 18.   John Fife
 19.   Thomas Gray                  Members of Barber-Surgeons’
 20.   Edward Hannan                   Company.
 21.   Edward Higgs
   And yet a few beside these, whose names are inscribed on no
human document, but whose deeds are imprinted in imperishable
type on the deathless record of righteous human endeavour.
    Nathaniel Hodges[187] shows us something of the daily life of a
physician in the course of this plague. He himself rose early, took his
antipestilential dose, attended to the affairs of his household, and
then repaired to his consulting room, where crowds awaited him.
Some, who were sick, he treated, others he reassured and sent
away. Breakfast followed, then visits to patients at their homes. On
entering a house he would vaporize some aromatic disinfectant on a
charcoal brazier: if he arrived out of breath, he would rest a while,
and then place a lozenge in his mouth, before proceeding to the
examination of his patients. After a round of several hours’ duration,
he would return home, drink a glass of sack, and then dine on roast
meat and pickles or some similar condiments, all of which were
reputed antidotal. More wine followed the preliminary curtain-raiser.
Afternoon and evening, till eight or nine o’clock, were devoted to a
second round of visits. His late hours he spent at home, a stranger
to noxious fumes of tobacco, quaffing sack, to ensure cheerfulness
and certainty of sleep. Twice the fatal infection seemed to have
slipped past his outposts, but Hodges had still his remedy: he merely
doubled the dose.
    Of all the literature of pestilence none has been more widely read
than Defoe’s Journal of the Plague Year: all later records take their
colour from Defoe. Nevertheless, a careful study and comparison of
other contemporary accounts leaves little room for doubt that
Defoe’s picture does not accurately represent the general state of
London during the plague. His picture is far more true of Marseilles
in 1720 than of London in 1665, and in this connexion one should
remember that he had sedulously collected materials for a diary of
the plague of Marseilles, which have been printed in some editions
of his works. These can hardly have failed to colour his Journal,
which was not submitted to the public till 1722, two years after the
plague of Marseilles.
   Defoe himself was but six years old at the time of the plague, so
that his own childish memories can have aided him but little in his
task. He will have had, at most, a dim recollection of some hideous
catastrophe, round which ranged tales of parents and friends in his
boyhood. To these he will have added facts and incidents borrowed
from the chief records available in print. Intrinsic evidence goes to
show that these were three: London’s Dreadful Visitation, Hodges’s
Loimologia, and Vincent’s God’s Terrible Voice in the City. The first of
these will have given him the Bills of Mortality and other general
information: the second, the aspect of the plague from a physician’s
point of view: the third, a vision of the plague as it appealed to
popular imagination.
    That Defoe intended to write history and not fiction, there is no
reason to doubt. Judged only by the accuracy of his facts it is
history, but it is in the facts that he omits, just because he had never
heard of them, that he unconsciously lapses into fiction. Comparison
of details and incidents with the unimpeachable record of Pepys
confirms his accuracy, but it shows also that, by separating incidents
from their surroundings and by compressing his description to the
exclusion of all but selected incidents, the picture, as a whole, does
not accurately represent the aspect of the city, as it was. Pepys, who
was an actual eye-witness, has noted not only the most striking
events but those of everyday commonplace interest, so that his
narrative is far more true to life. Defoe, on the other hand, has
removed his picture from its setting. Pepys shows us that, though
the spectre of plague was everywhere, everyday life went on,
though in subdued fashion. Defoe would have us believe that all
activity was paralysed.
     For all this, however, as one reads the Journal the narrative has
such an air of verisimilitude, that one instinctively pictures the writer
as describing what he has seen with his own eyes, so perfect is the
illusion. Mead, indeed, himself an authority on the plague and so
soon after the event, believed that the Journal was the authentic
record of an eye-witness. Defoe’s faculty of visualizing what he has
not seen is inferior only to the vividness with which he describes
what he has visualized.
    What is the secret of this vividness? More than all else, extreme
simplicity of language. The simple style was Defoe’s natural style,
and for that reason his use of it is fluent and easy, and knowing this
he fitly puts his story into the mouth of a simple saddler. Defoe
wrote for a growing class of readers of a lowly social order. He is the
apostle of the common people: that is why he imitates their way of
speaking. Not only is his narrative colloquial, but it deliberately
affects the language a saddler would use in reciting to his intimates
the memories of what he had lived through. There is no striving for
dramatic effect, no drawing of lurid pictures, no literary artifice, but
always the same sustained simplicity of diction, even in describing
the most appalling occurrences. There must be no chance of missing
the smallest point, so he even does such thinking as is necessary by
running comments on his own story.
     The educated reader, particularly in these days, when even
literature is administered in tabloid form, must needs be wearied by
the prolixity, and irritated by the redundancy of the narrative. But
again it must be pleaded in extenuation that these very defects are
deliberate. Constant repetition, as every teacher knows, sooner or
later penetrates the densest brain.
    But the Journal is something more than a mere chronicle, vivid
enough at that, of what happened, and how men behaved, during
the plague. Defoe regards the plague as the judgement of God, and
this attitude imparts a strong moral purpose to the work. This is why
he dwells so much on the mental and moral effects of the
catastrophe, inculcating his lesson without the appearance of undue
insistence. Pepys, as we know, could find heart to make merry
during the plague, just as Boccaccio depicted his company of
Florentines: to Defoe the mere idea of merriment is revolting. Pepys,
on New Year’s Eve, as he looked back over the abomination of
desolation, could make this entry in his Diary:
          ‘December 31, 1665. I have never lived so merrily
       (besides that I never got so much) as I have done this
       plague time ... and great store of dancings we have
      had at my cost (which I am willing to indulge myself
      and wife) at my lodgings. The great evil of this year,
      and the only one indeed, is the fall of my Lord of
      Sandwich, whose mistake about the prizes hath
      undone him.’
    Pepys was a stranger to imagination: his pleasures and his griefs
were things of the surface and matters of the moment. His creed is
egoistic hedonism in all its naked brutishness. He is far more
concerned over the fire, where there is a chance of losing his
property, than over the plague where the chance is of losing his life.
His New Year’s Eve retrospect is not the only glimpse he gives us of
callous indifference to the horrors of the plague. Look at September
30, 1665, when the fiercest spell was only just past:
           ‘So to sleep with a good deal of content, and saving
      only this night and a day or two about the same
      business a month or six weeks ago, I do end this
      month with the greatest content, and may say that
      these three months, for joy, health, and profit, have
      been much the greatest that ever I received in all my
      life, having nothing upon me but the consideration of
      the sicklinesse of the season during this great plague
      to mortify mee. For all which the Lord God be praised!’
    It was not that Pepys was unconscious of the terrible scenes of
suffering around him, only that he was unmoved by them. Into one
short letter to Lady Cartaret, at the height of the plague, he
compresses all the grim details that fill a volume for Defoe.
    Historians frequently lay it down that the fire of London swept
away the plague. As a fact it probably had little to do with its
departure. Several English towns were as hard hit as London, and
yet in the absence of any conflagration subsidence and
disappearance of plague followed the same course as in London. At
Salonica,[188] about a.d. 1500, a fire which destroyed 8,000 houses
was actually followed by an outbreak of plague. It was a common
contemporary belief that the departure of plague from London was
hastened by the coming of pit-coal into general use, so that the
atmosphere was constantly permeated by sulphurous fumes.
     Records in art of the Great Plague of London, though numerous,
are mostly unimportant. Generally artists have been content to
illustrate its copious literature. In 1863 Frederic Shields commenced
an intended series of illustrations of the Journal of Defoe. Ruskin
lavished great praise on the woodcuts, for their imaginative power
and for the superlative excellence of the design. Proofs of six of
these woodcuts were to be seen at the Memorial Exhibition of the
works of Shields (Alpine Club, September-October 1911). The set of
six comprised the following scenes:
                      1. The Decision of Faith
         A man is seated at a table, on which lies a Bill of
      Mortality, with his Bible open before him. He says to
      himself, ‘Well I know not what to do, Lord direct me.’
      His finger points to the answer in the open Bible:
      ‘Because thou hast made the Lord, which is my refuge,
      even the most High, thy habitation: there shall no evil
      befall thee, neither shall any plague come nigh thy
      dwelling.’
                   2. The Death of the First-born
         A youth lies in convulsions on a bed, while a
      woman kneels beside it. In the background are bearers
      carrying away a corpse: both are smoking pipes. On
      the ground lies an hour-glass.
             3. Solomon Eagle warning the Impenitent
          Solomon Eagle stands with a brazier of live coals on
      his head in a fierce preaching attitude before a group
      of lewd young women at an open window.
                      4. The End of a Refugee
         A man with a long hooked pole is dragging a
      corpse along. Beside him stands a grave-digger with
       spade, dog, and dinner-basket.
                           5. The Plague-Pit
           Bodies are being shot from a cart into a pit by the
       light of a torch, which a man is holding.
                  6. Escape of an Imprisoned Family
           The door of a house has been hacked down, and is
       lying on a dead body.
    George Cruickshank contributed four plates to Brayley’s edition of
the Journal of the Plague Year. Three of them, the ‘Dead Cart’, the
‘Great Pit in Aldgate’, and ‘Solomon Eagle’ are vivid and powerful;
the fourth, ‘The Water-man’s Wife’, feeble and commonplace.
    The preaching of Solomon Eagle is the subject of a picture by P.
F. Poole, R.A., in the Mappin Gallery at Sheffield. The scene depicted
is taken from Harrison Ainsworth’s novel Old Saint Paul’s. It shows
Solomon Eagle, with the brazier of live coals on his head, nude but
for a loin-cloth; and discoursing to the terrified citizens outside old St
Paul’s Cathedral, during the plague. All around are strewn bodies of
dead and dying: a house displays the damning red cross and the
words ‘Lord have mercy upon us’. In the background bearers are
carrying away a corpse to burial.
    An incident, that Pepys describes in his Diary under September 3,
1665, as follows, is represented in a modern picture by Miss
Florence Reason.
           ‘Among other stories, one was very passionate,
       methought, of a complaint brought against a man in
       the towne for taking a child from London from an
       infected house. Alderman Hooker told us it was the
       child of a very able citizen in Gracious Street, a saddler,
       who had buried all the rest of his children of the
       plague, and himself and his wife now being shut up
       and in despair of escaping, did desire only to save the
       life of this little child: and so prevailed to have it
      received stark-naked into the arms of a friend, who
      brought it (having put it into new fresh clothes) to
      Greenwich; where, upon hearing the story, we did
      agree it should be permitted to be received and kept in
      the towne.’
     In 1679 a terrible epidemic of plague broke out in Vienna, then
an opulent city, with a population of some 210,000, and the seat of
Leopold, the Holy Roman Emperor. Our chief knowledge of the
visitation is derived from Sorbait (Consilium medicum oder
freundliches Gespräch), Abraham a St. Clara (Merk’s Wien), and
Fuhrmann (Alt- und Neu-Wien). The disease was preceded by an
epidemic of the ‘Hot Sickness’, (Hitzige Krankheit), which was very
fatal. Bubonic plague followed in its wake and Vienna presented the
spectacle of one huge lazaretto for the sick, one gigantic plague-pit
for the dead. Convicts, as at Naples, were employed both to nurse
the sick and bury the dead. Clothing, furniture, and bedding lay
littered in the streets mixed with the dead and dying. When carts
failed, the bodies were thrown into the Danube. A Plague Committee
strove in vain to shut up all infected houses and segregate the
inmates in lazarettos and stations of quarantine. Death by public
hanging was the penalty of disobedience. Some of the royal princes,
and foremost among them Prince Ferdinand of Schwartzenburg,
together with many of the nobility, devoted themselves courageously
to fighting the plague, undertaking even the most menial duties. But
many of the citizens and the Emperor himself fled. Leopold
conceived his obligations to his people discharged by a pilgrimage to
Maria-Zell to pray for cessation of the plague. Then he moved his
court to Prague, whence plague drove him to Linz.
    During the plague the Viennese set up a wooden column, to
which frequent processions were made, observing the ancient ritual
of the Flagellants. At the end of the plague Leopold made a vow at
St. Stephan’s to replace it by a marble column, which was duly
erected in the Graben between 1687-93.
   An incident of this plague, the story of the street-singer Augustin,
who was thrown alive, but drunk, into the plague-pit, but escaped
none the worse for his experience, recalls the like occurrence in
Defoe. The man is said to have composed the familiar ‘O du lieber
Augustin’ in a beer-house on the very night he was thrown into the
plague-pit.
    Amulets of various kinds were extensively employed in the
seventeenth century. In South Germany a common form was the so-
called Pest Penny. These had on one face, as a rule, the figure of St.
Benedict or St. Zacharias, and on the reverse some formula of
exorcism.
    Vienna[189] fell a victim to outbreak after outbreak of plague, but
the experience gained in the visitation of 1679 enabled the
authorities to stamp out the infection in 1691 and 1709, before it
had grown out of hand. But in 1713 all preventive measures failed to
check its spread. Then, in the month of May, processions and litanies
were organized to the plague column. The Emperor Charles VI
remained in Vienna, and pronounced a solemn vow in St. Stephan’s,
that if the plague ceased he would erect a church as a thank-
offering. Such was the origin of the Karlskirche. This church is a rich
square edifice with a huge dome. It is the chef-d’œuvre of J. B.
Fischer von Erlach, commenced in 1715. The ravages of the plague
are portrayed in relief, by Stanetti, in the tympanum. Flanking the
portico are two domed belfries, resembling Trajan’s column, 108 feet
high, with reliefs from the life of S. Carlo Borromeo by Mader and
Schletter. In March 1714, when the plague died out after a total
mortality of 120,000, a thanksgiving Te Deum was sung in St.
Stephan’s, at which the emperor was present. Two series of
memorial coins were struck, the one showing the votive column, the
other the church dedicated to S. Carlo Borromeo.
    The Plague Regulations, published in separate form at Vienna at
the time of this epidemic, give a good idea of current popular
opinion as to the nature of plague. There was no lack of adherents
for each belief of every preceding period. There were those who
regarded it as a signal evidence of God’s displeasure. There were
those who attributed it to poison in the air or food, generated in the
stars and spread by the malice of grave-diggers for their own
purposes. Even the Jews were incriminated. There were those who
read its origin in the conjunction of certain stars. Others ascribed it
to famines, to poisonous fumes set free by earthquakes, to comets,
and even to dry seasons through the multiplication of insects. Come
how it might, clouds taking the form of biers and funeral
processions, noises in churchyards, and dreary sounds in the air
foretold its coming. On infected bodies the virus was often visible as
blue sulphurous fumes. There were clearly also some who conceived
a natural origin. A doctor, named Gregorovius, dissected three dead
bodies in search of the cause, but failed to find it. His intrepid zeal
was duly rewarded by the Emperor and by the Faculty of Medicine in
Vienna.
     Conformably with the varying conceptions of cause, remedies
were varied and multifarious. Some pinned their faith to a devout
life, aided by processions and penitential sermons. Some lit fires to
cleanse the air, at times adding sulphur. A host of herbs, chief
among them Angelica, enjoyed repute as antipestilential remedies.
The simple life appealed to some, purgatives and blood-letting to
others.
    But side by side with this ill-assorted medley of measures, a code
of sanitary precautions had slowly grown up. Early notification by the
doctors, quarantine of suspects and segregation of the sick,
cleanliness and disinfection were all recommended and sedulously
executed, and supplied in embryo the essential principles of modern
sanitary science. Doctors were enjoined to keep sober, to fumigate
themselves, and to wear silk or taffetas, to which the virus would
not cling. We have arrived indeed at the parting of the ways, and
henceforth the stream of medical science, polluted less and less by
the surface waters of superstition, flows on clear and full in its
appointed channel. The sun of science emerges at length from its
protracted winter solstice.
                     CHAPTER XIII
    In the year 1720 plague found its way to Marseilles. It was
believed to have been brought by a ship, the Grand-Saint-Antoine,
which arrived on May 25 from the Levant. As usual, the attempt was
made to hush it up for the sake of trade. At the beginning of August
something had to be done, so on the advice of two physicians,
Sicard, father and son, it was decided to light bonfires throughout
the city. For lack of firewood this was not done, but also for lack of
faith, for it was found that despite their vaunted specific, the Sicards
had fled the city. So sulphur was served out to the poor instead,
wherewith to ‘perfume’ their houses.
    As early as August 2 the Town Council found it necessary to
adopt special measures to keep physicians and surgeons to their
task. Accordingly, they decided that the city should pay them a fixed
salary in place of fees from the sick, and allow them smocks of oiled
cloth, and sedan chairs to carry them on their rounds. There are
several illustrations extant of the dress adopted by doctors in the
plague of Marseilles. The same dress, with trifling variations, was
worn elsewhere in France, in Switzerland, and in Germany, and had
originated in Italy. It is shown in an old Venetian woodcut of a.d.
1493, from the works of Joannes de Ketham (Fasciculus Medicinae,
1493). This woodcut shows a physician in a long overall, but wearing
only a skull-cap on his head, visiting a plague patient in bed. He is
accompanied by attendants who carry lighted torches, while he
himself holds a medicated sponge before his mouth and nose, as he
feels the pulse. Grillot figured the dress as the frontispiece of his
Lyon affligé de la peste 1629, and Manget[190] has borrowed it from
him. From his description it would seem that the mantle, breeches,
shirt, boots, gloves, and hat were all of morocco leather. The beak
attached to the mask was filled with aromatics, over which the air
passed in respiration, and had an aperture for each eye, fitted with a
disk of crystal.
          PLATE XXVIII,
1. DRESS OF A MARSEILLES DOCTOR,
               1720
                       PLATE XXVIII,
                  2. GERMAN CARICATURE
                       OF THE SAME
                          (Face Page 200)
    M. Reber[191] describes an engraving by John Melchior Fuesslin,
representing a doctor in the plague of Marseilles. The legend
beneath it, in German, is (translated) ‘Sketch of a Cordovan-leather-
clad doctor of Marseilles, having also a nose-case filled with smoking
material to keep off the plague. With the wand he is to feel the
pulse.’ Reber’s and Manget’s plates are both reproduced in the Bristol
Medico-Chirurgical Journal, March 1898, from the Janus blocks.
Gaffarel[192] gives the costumes both of a doctor and of a hospital
attendant: they closely resemble the dress of the Italian charitable
guilds of the fifteenth and sixteenth centuries.
    By August 9 some of the physicians and almost all the master-
surgeons had fled, and an ordinance was issued demanding their
return, or in default their expulsion from their respective
corporations, and other special penalties as well. Two physicians
named Gayon volunteered their services for the Hôpital des
Convalescents, but forthwith paid the penalty with their lives. In the
absence of sufficient physicians in Marseilles, others were
summoned from Montpellier, Paris, and elsewhere. These exhausted
their energies in a dispute over the contagious character of plague.
Chicoyneau and Chirac maintained that it was not contagious.
Deidier proved, by successfully inoculating dogs with bile taken from
plague subjects, that at any rate it was communicable. Each
subsequently expounded his views in a formal discourse before the
School of Montpellier.
    Existing hospital accommodation was quite unequal to the needs.
Emergency tents were erected outside the town, with mattresses for
the sick. Chevalier Rose equipped and maintained a hospital in the
district entrusted to him, at his own expense. A large temporary
hospital of timber covered with sail-cloth was hurriedly erected, but
when almost finished towards the end of September it was blown
down by a gale, and was not rebuilt till October 4. This hospital,
together with the Hôpital Général de la Charité of 800 beds,
provided ultimately sufficient accommodation, so that none need
remain in the streets.
   From the first the mortality was such that it was wellnigh
impossible to bury the dead. On August 8 the Assembly resolved
that carts should be used to carry the dead to burial, and that pits
should be dug in which the bodies could be buried in lime. So two
huge pits were dug outside the walls, between the gate of Aix and
that of Joliette, M. Moustier overseeing the diggers and compelling
them to work. Chevalier Rose also had pits dug and organized a
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
                        ebookultra.com