Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Game Programming by Example

You're reading from  Android Game Programming by Example

Product type Book
Published in Jun 2015
Publisher
ISBN-13 9781785280122
Pages 388 pages
Edition 1st Edition
Languages
Author (1):
John Horton John Horton
Profile icon John Horton

Table of Contents (18) Chapters

Android Game Programming by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Player 1 UP 2. Tappy Defender – First Step 3. Tappy Defender – Taking Flight 4. Tappy Defender – Going Home 5. Platformer – Upgrading the Game Engine 6. Platformer – Bob, Beeps, and Bumps 7. Platformer – Guns, Life, Money, and the Enemy 8. Platformer – Putting It All Together 9. Asteroids at 60 FPS with OpenGL ES 2 10. Move and Draw with OpenGL ES 2 11. Things That Go Bump – Part II Index

Summary


We finished the platform game because that is all there is space for. Why not try to implement some or all of the following improvements and features?

Change the code in the Player class to make Bob gradually accelerate and decelerate instead of always running at full speed. Simply increment the velocity for each frame that the player is holding down left or right, and decrement it for each frame they are not.

Once you have achieved this, add the preceding code to the collision detection switch block in the update method to make the player skid on snow, speed up on concrete, and have a different walking/landing sound effect for each tile type.

Draw a gun on Bob, and adjust the height that the Bullet object is spawned at to appear as if it is coming from the barrel of his machine gun.

Make some objects pushable. Add an isPushable member to GameObject and make the collision detection simply knock the object back a little. Perhaps, Bob could push mine carts into fire to jump over extra...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}