Learning Libgdx Game Development
eBook - ePub

Learning Libgdx Game Development

  1. 388 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Libgdx Game Development

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

Game development is a field of interdisciplinary skills, which also makes it a very complex topic in many respects. One decision that usually needs to be made at the beginning of a game development processis to define the kind of computer system or platform the game will be developed for. This does not pose any problems in general but as soon as the game should also be able to run on multiple platforms it will become a developer's nightmare to maintain several distinct copies of the same game. This is where the libGDX multi-platform game development framework comes to the rescue!

"Learning Libgdx Game Development" is a practical, hands-on guide that provides you with all the information you need to know about the libGDX framework as well as game development in general so you can start developing your own games for multiple platforms. You will gradually acquire deeper knowledge of both, libGDX and game development while you work through twelve easy-to-follow chapters.

"Learning Libgdx Game Development" will walk you through a complete game development cycle by creating an example game that is extended with new features over several chapters. These chapters handle specific topics such as organizing resources, managing game scenes and transitions, actors, a menu system, using an advanced physics engine and many more. The chapters are filled with screenshots and/or diagrams to facilitate comprehension.

"Learning Libgdx Game Development" is the book for you if you want to learn how to write your game code once and run it on a multitude of platforms using libGDX.

Approach

A clear and practical guide to building games in libGDX.

Who this book is for

This book is great for Indie and existing game developers, as well as those who want to get started with game development using libGDX. Java game knowledge of game development basics is recommended.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Learning Libgdx Game Development by Andreas Oehlke in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.

Information

Year
2013
ISBN
9781782166047
Edition
1

Learning Libgdx Game Development


Table of Contents

Learning Libgdx Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to Libgdx and Project Setup
Diving into Libgdx
Features of Libgdx 0.97
Graphics
Audio
Input Handling
File I/O
Math and Physics
Utilities
Tools
Getting in touch with the community
Prerequisites for installing and configuring
Java Development Kit (JDK)
Eclipse – Integrated Development Environment (IDE)
Downloading Libgdx
Installing Android SDK
Running Eclipse and installing plugins
Creating a new application
Kicking your game to life
Key to success lies in planning
Game project – Canyon Bunny
Description of the game
Summary
2. Cross-platform Development – Build Once, Deploy Anywhere
The demo application – how the projects work together
Backends
LWJGL (Lightweight Java Game Library)
Android
WebGL
Modules
The application module
Logging
Shutting down gracefully
Persisting data
Querying the Android API Level
Querying the platform type
Querying memory usage
Graphics module
Querying delta time
Querying display size
Querying the FPS (frames per second) counter
Audio module
Sound playback
Music streaming
Input module
Reading the keyboard/touch/mouse input
Reading the accelerometer
Starting and canceling vibrator
Catching Android soft keys
The files module
Getting an internal file handle
Getting an external file handle
The network module
HTTP GET and HTTP POST
Client/server sockets
Opening a URI in a web browser
Libgdx's Application Life-Cycle and Interface
Starter Classes
Running the demo application on a desktop
Running the demo application on Android
Running the demo application in a WebGL-capable web browser
The demo application – time for code
Inspecting an example code of the demo application
The create() method
The render() method
The dispose() method
Having fun with the debugger and Code Hot Swapping
Summary
3. Configuring the Game
Setting up the Canyon Bunny project
Using a class diagram for Canyon Bunny
Laying foundations
Implementing Constants
Implementing CanyonBunnyMain
Implementing WorldController
Implementing WorldRenderer
Putting it all together
Building the game loop
Adding test sprites
Adding game world's debug controls
Adding CameraHelper
Adding camera debug controls using CameraHelper
Summary
4. Gathering Resources
Setting a custom Android application icon
Creating texture atlases
Loading and tracking assets
Organizing assets
Testing assets
Handling level data
Summary
5. Making a Scene
Creating game objects
The rock object
The mountains object
The water overlay object
The clouds object
Implementing the level loader
Assembling the game world
Implementing the game GUI
The GUI score
The GUI extra lives
The GUI FPS counter
Rendering the GUI
Summary
6. Adding the Actors
Implementing the actor game objects
Creating the gold coin object
Creating the feather object
Creating the bunny head object
Updating the rock object
Completing the level loader
Adding the game logic
Adding collision detection
Losing lives, game over, and fixing the camera
Adding the game over text and the feather icon to the GUI
Summary
7. Menus and Options
Managing multiple screens
Exploring Scene2D (UI), TableLayout, and skins
Using Libgdx's scene graph for the menu UI
Building the scene for the menu screen
Adding the background layer
Adding the objects layer
Adding the logos layer
Adding the controls layer
Adding the Options window layer
Building the Options window
Using the game settings
Summary
8. Special Effects
Creating complex effects with particle systems
Adding a dust particle effect to the player character
Moving the clouds
Smoothing with Linear interpolation (Lerp)
Letting the rocks float on the water
Adding parallax scrolling to the mountains in the background
Enhancing the game screen's GUI
Event – player lost a life
Event – score increased
Summary
9. Screen Transitions
Adding the screen transition capability
Implementing transition effects
Knowing about interpolation algorithms
Creating a fade transition effect
Creating a slide transition effect
Creating a slice transition effect
Summary
10. Managing Music and Sound Effects
Playing back music and sound effects
Exploring the Sound interface
Exploring the Music interface
Accessing the audio device directly
Exploring the AudioDevice interface
Exploring the AudioRecorder interface
Using sound generators
About the sfxr generator
About the cfxr generator
About the bfxr generator
Adding music and sounds to Canyon Bunny
Summary
11. Advanced Programming Techniques
Simulating physics with Box2D
Exploring the concepts of Box2D
Understanding rigid bodies
Choosing body types
Using shapes
Using fixtures
Simulating physics in the world
Physics body editor
Preparing Canyon Bunny for raining carrots
Adding the new assets
Adding the carrot game object
Adding the goal game object
Extending the level
Letting it rain carrots
Working with shaders in Libgdx
Creating a monochrome filter shader program
Using the monochrome filter shader program in Canyon Bunny
Adding alternative input controls
Summary
12. Animations
Manipulating actors through actions
Actions for manipulating actors
Controlling the order and time of execution
Animating the menu screen
Animating the gold coins and bunny head actors
Animating the menu buttons and options window
Using sequences of images for animations
Packing animations using the texture packer
Choosing between animation play modes
Animating the game screen
Defining and preparing new animations
Animating the gold coin game object
Animating the bunny head game object
Summary
Index

Learning Libgdx Game Development

Copyright © 2013 Packt Publishing
All 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 accura...

Table of contents

  1. Learning Libgdx Game Development