更新时间:2021-08-06 19:16:34
coverpage
Learning Java by Building Android Games
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Why Java Android and Games?
Is this book for me?
Why build games to learn to program?
Why Android and Java?
Setting up our development environment
Summary
Chapter 2. Getting Started with Android
Our first game project
Exploring Android Studio
Using the Android Studio visual designer
Structuring our code for Android
Our first look at Java
Building and installing our game
Self-test questions
Chapter 3. Speaking Java – Your First Game
Java syntax
Storing data and using it with variables
Expressing yourself in Java
Math game – asking a question
Decisions in Java
Math game – getting and checking the answer
Chapter 4. Discovering Loops and Methods
Looping with loops
Methods
Enhancing our math game
Finishing touches
Chapter 5. Gaming and Java Essentials
Java arrays – an array of variables
Timing with threads
Beeps n buzzes – Android sound
Life after destruction – persistence
The memory game
Chapter 6. OOP – Using Other People's Hard Work
What is OOP?
Our first class and first object
Encapsulation
Inheritance
Polymorphism
More about OOP and classes
Chapter 7. Retro Squash Game
Drawing with Android Canvas
Android Canvas demo app
Detecting touches on the screen
Preparing to make the retro squash game
The four implementation phases in detail
Chapter 8. The Snake Game
Game design
The coordinate system
The code structure
Animation sprite sheets and the Snake home screen
Implementing the Snake game activity
Enhancing the game
Chapter 9. Making Your Game the Next Big Thing
How to publish your app
Marketing your app
Adding leaderboards and achievements
What next?
Appendix A. Self-test Questions and Answers
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Index