文档介绍:Download from Wow! eBook <>
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author xxv
About the Technical Reviewers xxvii
Acknowledgments xxix
■■Chapter 1: Introduction to Lua 1
■■Chapter 2: Lua Libraries 13
■■Chapter 3: File Operations 29
■■Chapter 4: Math with Lua 41
■■Chapter 5: Strings 65
■■Chapter 6: Threading 77
■■Chapter 7: Tips and Tricks 97
■■Chapter 8: Corona SDK 127
■■Chapter 9: Gideros Studio 167
■■Chapter 10: Moai 203
■■Chapter 11: LÖVE 245
■■Chapter 12: Codea 279
v
vi Contents at a Glance
■■Chapter 13: Libraries 303
■■Chapter 14: Third-Party Applications 317
■■Chapter 15: Sample Source Code 349
Index 377
Chapter 1
Introduction to Lua
Apple has been issuing checks to developers, and the 2012 figures indicate that it has so far been
to the tune of $5 billion. In the past, it used to be desktops with Microsoft-based products that were
raking in money for developers, with Visual Basic, or earlier with database products such as dBase
and FoxPro. While the major share of this revenue goes to panies such as EA, Chillingo,
Gameloft, Rovio and even Disney, a lot of indie developers and panies vie for a share of
that big pie. Who knows what idea might just e the money-spinner for a developer. Robert Nay,
a 14-year-old, made the game Bubble Ball while he was learning to code, and it went viral, with over
8 million downloads. And no one knows what the next top game will be.
As a person that has an interest in development, you have made the first step in this journey. You
could be a student that has never developed before, or you could be a guru developer who can
whip up an enterprise app in minutes. The point is that whatever your background, you are for some
reason drawn to this strange-sounding language, Lua (pronounced LOO-ah.).
What Is Lua?
Lua is a progr