Apress - Pro Android Games (December 2009) (ATTiCA).pdf

(3650 KB) Pobierz
Apress - Pro Android Games (December 2009) (ATTiCA)
Create and port cool games like Space Blaster , classic Asteroids™ ,
Doom and Wolfenstein™ 3D using Android
Android Games
Vladimir Silva
Pro
262147314.072.png 262147314.083.png 262147314.094.png 262147314.105.png 262147314.001.png 262147314.007.png 262147314.017.png 262147314.028.png 262147314.032.png 262147314.033.png 262147314.034.png 262147314.035.png 262147314.036.png 262147314.037.png 262147314.038.png 262147314.039.png 262147314.040.png 262147314.041.png 262147314.042.png 262147314.043.png 262147314.044.png 262147314.045.png 262147314.046.png 262147314.047.png 262147314.048.png 262147314.049.png 262147314.050.png 262147314.051.png 262147314.052.png 262147314.053.png 262147314.054.png 262147314.055.png 262147314.056.png 262147314.057.png 262147314.058.png 262147314.059.png 262147314.060.png 262147314.061.png 262147314.062.png 262147314.063.png 262147314.064.png 262147314.065.png 262147314.066.png 262147314.067.png 262147314.068.png 262147314.069.png 262147314.070.png 262147314.071.png 262147314.073.png 262147314.074.png 262147314.075.png 262147314.076.png 262147314.077.png 262147314.078.png 262147314.079.png 262147314.080.png
BOOKS FOR PROFESSIONALS BY PROFESSIONALS ®
teroids™ ? Well, here’s an exciting opportunity to build and/or port these
games to one of the hottest mobile and netbook platforms today: Google’s
Android. Pro Android Games teaches you how to build cool games like Space
Blaster and the classic Asteroids™ from scratch on the latest Android plat-
form. This book also shows you how to port other classic freeware/shareware
games like Doom and Wolfenstein™ 3D from C using the Java Native Interface
(JNI) for Android.
This book is all about a unique perspective in Android game development:
a well-balanced, powerful combination of pure pure Java and hybrid game
development, mixing Java and C. I believe that in the world of gaming, per-
formance is critical, and that by combining the elegant object-oriented fea-
tures of Java and the raw power of C, there is no limit to the types of games
that you can build for the platform. With actionable real-world source code
in hand, this book dives you right into Games development on Android. In
this book you’ll learn how to:
setupaLinuxsystemforhybridgamecompilation
combineJavaandCcodeinanelegantmannerbybuildingasimple
Javaapplicationontopofanativelibrary
tacklepureJavagamingwithtwopracticalgames: Space Blaster and
thearcadeclassic Asteroids™
mixOpenGLAPIcallsinJavaandCforhighperformance3Dgraphics
usingthe3DcubessamplebyGoogle
bringtwoofthegreatestPC3DshooterstotheAndroidplatform:
Wolfenstein™ 3D and Doom usingJavaandC
By the end of this book, you will have learned how easy it is to bring native
PC games alive on the Android platform, which is now growing in popularity
at an amazing rate. Pro Android Games is the ultimate helper tool for your
hybrid game development needs, so you’ll be developing games quickly on
Google’s Android.
COMPANIONeBOOK
SEELASTPAGEFORDETAILSON$10eBOOKVERSION
ISBN 978-1-4302-2647-5
53999
US $39.99
Shelve in
Mobile Computing
SOURCE  CODE ONLINE
User level:
Intermediate-Advanced
www.apress.com
9 781430 226475
D o you remember landmark games like Wolfenstein™ 3D, Doom , and As-
262147314.081.png 262147314.082.png 262147314.084.png 262147314.085.png 262147314.086.png 262147314.087.png 262147314.088.png 262147314.089.png 262147314.090.png 262147314.091.png 262147314.092.png 262147314.093.png 262147314.095.png 262147314.096.png 262147314.097.png 262147314.098.png 262147314.099.png 262147314.100.png 262147314.101.png 262147314.102.png 262147314.103.png 262147314.104.png 262147314.106.png 262147314.107.png 262147314.108.png 262147314.109.png 262147314.110.png 262147314.111.png 262147314.112.png 262147314.113.png 262147314.114.png 262147314.115.png 262147314.002.png 262147314.003.png 262147314.004.png 262147314.005.png 262147314.006.png 262147314.008.png 262147314.009.png 262147314.010.png 262147314.011.png
 
262147314.012.png 262147314.013.png 262147314.014.png 262147314.015.png 262147314.016.png 262147314.018.png 262147314.019.png 262147314.020.png 262147314.021.png 262147314.022.png 262147314.023.png 262147314.024.png 262147314.025.png 262147314.026.png 262147314.027.png
Pro Android Games
■ ■ ■
Vladimir Silva
262147314.029.png
Pro Android Games
Copyright © 2009 by Vladimir Silva
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying, recording, or by any information
storage or retrieval system, without the prior written permission of the copyright owner and the
publisher.
ISBN-13 (pbk): 978-1-4302-2647-5
ISBN-13 (electronic): 978-1-4302-2648-2
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.
President and Publisher: Paul Manning
Lead Editor: Steve Anglin, Douglas Pundick
Technical Reviewer: Kunal Mittal and Vikram Goyal
Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell,
Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes,
Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic
Shakeshaft, Matt Wade, Tom Welsh
Coordinating Editor: Fran Parnell
Copy Editors: Heather Lang and Marilyn Smith
Formatter: Nancy Wright
Compositor: LaurelTech
Indexer: BIM Indexing and Proofreading Services
Artist: April Milne
Cover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street,
6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail
orders-ny@springer-sbm.com , or visit http://www.springeronline.com .
For information on translations, please e-mail info@apress.com , or visit http://www.apress.com .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional
use. eBook versions and licenses are also available for most titles. For more information, reference
our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales .
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall
have any liability to any person or entity with respect to any loss or damage caused or alleged to be
caused directly or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com . You will need to
answer questions pertaining to this book in order to successfully download the code.
Contents at a Glance
Contents..................................................................................................................... iv
About the Author ........................................................................................................ x
About the Technical Reviewer ................................................................................... xi
Introduction .............................................................................................................. xii
Chapter 1: Welcome to Android Gaming................................................................. 1
Chapter 2: Compiling Native Code in Android ...................................................... 27
Chapter 3: Building a Java Game from Scratch ................................................... 55
Chapter 4: Java Games Continued: Fun with Polygons ........................................ 81
Chapter 5: Hybrid 3D Graphics with OpenGL and JNI ......................................... 117
Chapter 6: 3D Shooters Episode I: Wolfenstein 3D for Android .......................... 161
Chapter 7: 3D Shooters Episode II: Doom for Android........................................ 221
Appendix: Deployment and Compilation Tips ..................................................... 271
Index: ................................................................................................................. 287
262147314.030.png 262147314.031.png
Zgłoś jeśli naruszono regulamin