AndEngine for Android Game Development Cookbook pdf

380 4,919 40
  • Loading ...
1/380 trang
Tải xuống

Thông tin tài liệu

Ngày đăng: 17/03/2014, 03:20 for Android Game Development CookbookOver 70 highly effective recipes with real-world examples to get to grips with the powerful capabilities of AndEngine and GLES 2Jayme SchroederBrian BroylesBIRMINGHAM - for Android Game Development CookbookCopyright © 2013 Packt PublishingAll rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.First published: January 2013Production Reference: 1070113Published by Packt Publishing Ltd.Livery Place35 Livery StreetBirmingham B3 2PB, UK.ISBN 978-1-84951-898-7www.packtpub.comCover Image by Jayme Schroeder ( SchroederBrian BroylesReviewersMateusz MysliwiecSergio Viudes CarbonellJafar Abdulrasoul [Jimmar]Acquisition EditorKartikey PandeyLead Technical EditorSweny M. SukumaranTechnical EditorsSharvari BaetDominic PereiraProject CoordinatorPriya SharmaProofreaderKevin McGowanIndexerRekha NairGraphicsAditi GajjarProduction Coordinator Shantanu ZagadeCover WorkShantanu the AuthorsJayme Schroeder was introduced to computers at a very young age. By 11, he had started creating modications and level packs for his favorite game. By age 16, he had found his true passion in game development and network programming in C++ and OpenGL. In early 2011, Jayme had received an Android smartphone and immediately fell in love with the development experience. Since then, he has been researching and developing for the Android platform on a daily basis.There are many people I would like to thank for the opportunity to write this book and also thank those who helped me out every step of the way.First and foremost, I would like to thank Packt Publishing for the acceptance of AndEngine for Android Game Development Cookbook and Amber D'souza for rst approaching me with the opportunity to write this book. I would also like to thank Kartikey Pandey, Michelle Quadros, Sweny Sukumaran, Priya Sharma from Packt Publishing who all played a large part in making the writing process much easier than anticipated and comfortable for me. I would also like to thank Dominic Pereira and Sharvari Baet for the effort they've put in throughout the production stage and the suggestions they've made.I would like to thank Nicolas Gramlich for creating AndEngine. Not only has he created an amazing engine for novice and advanced developers alike, but he's created a great community for Android developers to both learn and strengthen their development skills relating to game development.I would like to also thank my co-author, Brian Broyles, for his contributions and commitment to the book. It's been an honor to share the experience with him.Finally, I would like to thank all of my family and friends who showed their support and provided feedback during this experience. More specically, I would like to thank Kent and Judy Schroeder; my parents, Shannon, Hollie, Taylor, and Brittanie; my brothers and sisters and my girlfriend, Krystal Guevremont. Of my friends, I would like to specically thank Leo Wandersleb and Jordi Puigdellívol, with whom I've spent many days discussing the ner details of AndEngine which greatly helped to improve my Broyles is a freelance programmer and 2D/3D graphic designer with over 12 years of experience. Before entering the mobile development industry in 2010 as the lead programmer of IFL Game Studio, he designed advanced articial intelligence systems and graphical effects for interactive PC applications. In addition to his vast programming and design experience, he is also a commercial pilot, instrument ight instructor, and advanced instrument ground instructor.I'd like to thank my amazing, beautiful wife, Bethany, for her support and enthusiasm as well as my family for encouraging me in all of my the ReviewersMateusz Mysliwiec was born 1993 in Tarnow, Poland, graduating from high school in 2012. He currently lives in England. During his last year of high school, he decided that he would like to study Software Engineering or a different subject connected with math, programming, and engineering. He is also an independent game developer. In his free time, he develops professional mobile games focusing especially on the Android platform. His goal is to permanently impact the global mobile gaming industry in the near future. He is active in a variety of projects, including open source. His passions away from game development are sports and recreation such as football, skydiving, and jogging. His family and friends are the important aspects of his life. Sergio Viudes is a 30 years old software developer from Elche (Spain). He works developing commercial web apps, and develops video games for Android in his free time.He likes to play video games since childhood. He started playing with his brother's Spectrum when he was 5 years old. When he bought his rst PC (well, his parents did), he was 14 years old, and started learning computer programming, computer drawing, and music composing (using the famous "FastTracker 2"). When he nished high school, he studied Computer Science at the University of Alicante.His interest in mobile devices started with his rst smart phone, ten years ago (2002), when he bought the rst Symbian device from Nokia, the Nokia 7650. He really liked the idea that he could develop software that could run everywhere. So, along with his studies and his job, Sergio started creating simple mobile apps for his phone. About two years ago he decided to create his rst video game for mobile devices. He really enjoys developing for mobile devices, he likes to compose music, he likes to draw, and, of course, he likes to play video games. So he decided to put all his hobbies together and develop his rst video game for his favorite mobile platform—Android.So far Sergio has released 3 games and he continues developing apps and games for Android as a hobby. He wishes that someday it will be his job, not just a Abdulrasoul—a graduate from the Kuwait University—is a Computer Engineer and an Android game enthusiast who wrote a couple of excellent tutorials on his blog about creating games using AndEngine. He is known online by the name Jimmar.My gratitude goes to my mother who tries to support me in everything I do, so thank you mama! les, eBooks, discount offers and moreYou might want to visit for support les and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub les available? You can upgrade to the eBook version at and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.At, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.TM Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? f Fully searchable across every book published by Packt f Copy and paste, print and bookmark content f On demand and accessible via web browserFree Access for Packt account holdersIf you have an account with Packt at, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate of ContentsPreface 1Chapter 1: AndEngine Game Structure 7Introduction 7Know the life cycle 8Choosing our engine type 14Selecting a resolution policy 17Creating object factories 18Creating the game manager 20Introducing sounds and music 23Working with different types of textures 27Applying texture options 34Using AndEngine font resources 39Creating the resource manager 42Saving and loading game data 45Chapter 2: Working with Entities 51Introduction 51Understanding AndEngine entities 52Applying primitives to a layer 58Bringing a scene to life with sprites 62Applying text to a layer 69Using relative rotation 74Overriding the onManagedUpdate method 77Using modiers and entity modiers 81Working with particle systems[...]... stylish and fun games by both independent and professional developers alike, and has even been used in some of the most successful games on the market to date However, it takes more than just using a specific framework to achieve success AndEngine for Android Game Development Cookbook provides many informative walkthroughs relating to the most important aspects of AndEngine at a general game- programming... downloads/8987OS_AppB_Final .pdf 2 Preface What you need for this book AndEngine for Android Game Development Cookbook is useful for the majority of AndEngine developers Starting with the first few chapters, the reader will begin to work with the basics of AndEngine, and even intermediate developers will find useful tips throughout... code, GIMP for image drawing/editing, and Inkscape for SVG drawing/editing Please feel free to use alternatives to these products if you are more comfortable with them Additionally, this book assumes the reader has obtained the required libraries, including AndEngine and its various extensions prior to working with the recipes Who this book is for AndEngine for Android Game Development Cookbook is... platform Creating a physics-based rope bridge Game level classes Input classes Layer classes Manager classes Menu classes 307 313 316 323 327 336 347 348 350 351 Index355 iii Table of Contents iv Preface AndEngine is an excellent, full-featured, free, and open source 2D framework for the Android platform It is one of few 2D frameworks for the Android platform... Creating the game manager The game manager is an important part of most games A game manager is a class that should contain data relating to gameplay; including, but not limited to keeping track of score, credits/currency, player health, and other general gameplay information In this topic, we're going to take a look at a game manager class to gain an understanding of how they work into our game structure... blocks of AndEngine and the game structure in order to create precise, organized, and expandable projects AndEngine Game Structure In this chapter, we're going to go over a few of the most necessary components of AndEngine and general game programming We're going to take a look at some classes that will aid us in quickly and efficiently creating a foundation for all sorts of games Additionally,... copied/pasted into our LayoutGameActivity class after step one has been completed: @Override protected int getLayoutID() { return R.layout.main; } @Override protected int getRenderSurfaceViewID() { return; } 13 AndEngine Game Structure The SimpleBaseGameActivity and SimpleLayoutGameActivity classes The SimpleBaseGameActivity and the SimpleLayoutGameActivity classes,... cycle of an AndEngine game to placing sprites on the scene and moving them around, all the way through to creating destructible objects and raycasting techniques Even more importantly, this book is entirely based on AndEngine' s latest and most efficient Anchor-Center branch What this book covers Chapter 1, AndEngine Game Structure, covers the important aspects of game development with AndEngine regarding... AndEngine Game Structure 3 Create a reset method that will revert all data back to their initial values: // Resetting the game simply means we must revert back to initial values public void resetGame(){ this.mCurrentScore = GameManager.INITIAL_SCORE; this.mBirdCount = GameManager.INITIAL_BIRD_COUNT; this.mEnemyCount = GameManager.INITIAL_ENEMY_COUNT; } How it works… Depending on the type of game. .. pOnPopulateSceneCallback.onPopulateSceneFinished(); } 9 AndEngine Game Structure How it works… The code found in this recipe's class is the foundation for any AndEngine game We've set up a main activity class which serves as the entry point into our application The activity contains the four main methods included in AndEngine' s activity life cycle that we are responsible for, beginning with creating the EngineOptions . .pdf. you need for this book AndEngine for Android Game Development Cookbook is useful for the majority of AndEngine. and foremost, I would like to thank Packt Publishing for the acceptance of AndEngine for Android Game Development Cookbook and Amber D'souza for
- Xem thêm -

Xem thêm: AndEngine for Android Game Development Cookbook pdf, AndEngine for Android Game Development Cookbook pdf, AndEngine for Android Game Development Cookbook pdf

Mục lục

Xem thêm

Gợi ý tài liệu liên quan cho bạn

Nạp tiền Tải lên
Đăng ký
Đăng nhập