Apress Practical Android 4 Games Development (2011).pdf

(11592 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Create 2D and 3D Android game apps,
using hands-on practical examples
Practical
Android 4 Games
Development
J. F. DiMarzio
850634589.033.png 850634589.044.png 850634589.054.png 850634589.059.png 850634589.001.png
 
 
 
 
 
 
 
 
850634589.002.png 850634589.003.png 850634589.004.png 850634589.005.png 850634589.006.png 850634589.007.png 850634589.008.png 850634589.009.png
 
 
 
 
 
 
 
850634589.010.png 850634589.011.png 850634589.012.png 850634589.013.png 850634589.014.png 850634589.015.png 850634589.016.png
 
 
850634589.017.png 850634589.018.png 850634589.019.png 850634589.020.png 850634589.021.png 850634589.022.png 850634589.023.png 850634589.024.png 850634589.025.png 850634589.026.png 850634589.027.png 850634589.028.png 850634589.029.png 850634589.030.png 850634589.031.png 850634589.032.png 850634589.034.png 850634589.035.png 850634589.036.png 850634589.037.png 850634589.038.png 850634589.039.png 850634589.040.png 850634589.041.png 850634589.042.png 850634589.043.png
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.
850634589.045.png 850634589.046.png
Contents at a Glance
Contents .............................................................................................................. v
Foreword ........................................................................................................... ix
About the Author................................................................................................. x
About the Technical Reviewers ......................................................................... xi
About the Game Graphics Designer .................................................................. xii
Acknowledgments ........................................................................................... xiii
Preface ............................................................................................................. xiv
Part I: Planning and Creating 2D Games ............................................................ 1
Chapter 1: Welcome to Android Gaming.......................................................... 3
Chapter 2: Star Fighter : A 2-D Shooter ......................................................... 15
Chapter 3: Press Start: Making a Menu ........................................................ 27
Chapter 4: Drawing The Environment............................................................ 73
Chapter 5: Creating Your Character ............................................................ 119
Chapter 6: Adding the Enemies ................................................................... 159
Chapter 7: Adding Basic Enemy Artificial Intelligence ................................ 177
Chapter 8: Defend Yourself! ........................................................................ 207
Chapter 9: Publishing Your Game................................................................ 243
Part II: Creating 3D Games ............................................................................. 253
Chapter 10: Blob Hunter : Creating 3- D Games ............................................ 255
Chapter 11: Creating an Immersive Environment ....................................... 271
Chapter 12: Navigating the 3-D Environment .............................................. 287
Index ............................................................................................................... 301
iv
850634589.047.png 850634589.048.png 850634589.049.png 850634589.050.png 850634589.051.png 850634589.052.png 850634589.053.png
 
I
Part
Planning and Creating
2D Games
The first part of this book, Chapter 1-9, will take you through the processes of planning
and creating a playable 2D Android game – Star Fighter. The creation of this game will
follow a distinct and logical path. First you will plan and write the story behind your game.
Next, you will create the background for the game. Then you will create the playable and
non-playable characters. Finally you will create the weapons systems and collision
detection. Before following the steps needed to deploy your game to a mobile device in
Chapter 9, at the end of Chapter 8, I provide the complete code listings of the most
important 2D files that you either created or modified in Part 1. Use these listings to
compare your code and ensure that each game runs properly. This will prepare you for the
3D development phase that follows in Part 2: “Creating 3D Games” (Chapters 10-12).
850634589.055.png
1
Chapter
Welcome to Android
Gaming
I began developing on Android in early 2008 on the beta platform. At the time, no
phones were announced for the new operating system and we developers genuinely felt
as though we were at the beginning of something exciting. Android captured all of the
energy and excitement of the early days of open source development. Developing for
the platform was very reminiscent of sitting around an empty student lounge at 2:00 a.m.
with a Jolt cola waiting for VAX time to run our latest code. It was an exciting platform to
see materialize, and I am glad I was there to see it.
As Android began to grow and Google released more updates to solidify the final
architecture, one thing became apparent: Android, being based on Java and including
many well known Java packages, would be an easy transition for the casual game
developer. Most of the knowledge that a Java developer already had could be recycled
on this new platform. The very large base of Java game developers could use that
knowledge to move fairly smoothly onto the Android platform.
So how does a Java developer begin developing games on Android and what tools are
required? This chapter aims to answer these questions and more. Here, you will learn
how to block out your game’s story into chunks that can be fully realized as parts of
your game. We’ll explore some of the essential tools required to carry out the tasks in
future chapters
This chapter is very important, because it gives you something that not many other
gaming books have—a true focus on the genesis of a game. While knowing how to write
the code that will bring a game to life is very important, great code will not help if you do
not have a game to bring to life. Knowing how to get the idea for your game out of your
head in a clean and clear way will make the difference between a good game and a
game that the player can’t put down.
3
850634589.056.png 850634589.057.png 850634589.058.png
Zgłoś jeśli naruszono regulamin