Preface

As personal computers have conquered our private homes, video games have become more and more popular and eventually a multimillion dollar business for big video game companies. With the introduction of mobile devices such as smartphones and tablets, the market for video games has experienced another significant increase; in particular, it has now become open to independent game developers with small budgets.

For game developers, it is essential to have tools at hand that provide fundamentals that allow rapid prototyping and cost-effective implementation of their creative ideas. This is where LibGDX comes into play. LibGDX, as a Java-based game development framework, provides a unified access layer to handle all the supported platforms. LibGDX also makes use of C/C++ to achieve cross-platform support as well as to boost the application performance for mission critical tasks.

This book will show you how easy it is to develop cross-platform games by walking you through a complete game development cycle using the free and open source library—LibGDX. Besides this, you will also learn about common game structure and the involved requirements.

You will be introduced to the key features of LibGDX. You will also learn how to develop a game with ease and speed up your development cycles. In ten easy-to-follow chapters, you will develop your first LibGDX cross-platform game and add more and more game functionalities as you progress further through this book.

The special features will also make you acquainted with advanced programming techniques such as animations, physics simulations, and shader programs that enhance your games in both their gameplay and visual presentation.

By the end of this book, you will have a fully working 2D game that will run on Windows, Linux, Mac OS X, WebGL-capable browsers, Android, and iOS. You will also have all the skills required to extend the game further or to start developing your own cross-platform games.

What this book covers

Chapter 1, Introduction to LibGDX and Project Setup, covers how to install and configure the development environment and introduces you to the project setup tool that comes with LibGDX. Then, we will take a first look at the basics of what a game needs to come alive.

Chapter 2, Cross-platform Development – Build Once, Deploy Anywhere, explains the supported target platforms and how to deploy and run our application on each platform using a demo application. For the first overview of LibGDX's API, we will take a glance at each module. Then, the application cycle will be introduced, and we will take a look at how to debug and manipulate our code at runtime.

Chapter 3, Configuring the Game, takes us from our demo application to a real game by setting up a new project called Canyon Bunny. We will work on this project throughout the rest of the book and extend it from chapter to chapter with new features. As LibGDX is a framework, we will first have to build our program architecture using UML class diagrams to structure our game engine.

Chapter 4, Gathering Resources, describes how to gather all the resources (assets) needed for Canyon Bunny, including graphics, audio files, level data, and so on. We will also find out how to load, track, and organize assets efficiently. Finally, it is time to think about how level data is going to be handled so that we are able to populate our game world with objects.

Chapter 5, Making a Scene, will implement the game objects such as rocks, mountains, and clouds. We will put the new code into action using a level loader. We will also add a Graphical User Interface (GUI) to the game scene to show the player's score, extra lives and frames per second to measure the games performance.

Chapter 6, Adding the Actors, explains how to add the remaining game objects for Canyon Bunny, including the player character and collectible items to complete our game. We will also add simple physics for player movement and basic collision detection. Additionally, the game logic will be extended so that it is able to detect the "life lost" and "game over" conditions.

Chapter 7, Menus and Options, describes how to create a menu system with widgets such as buttons, labels, and checkboxes to enrich the overall game experience. Furthermore, we will add an Options window where the player can adjust the game settings.

Chapter 8, Special Effects, covers how to make use of particle systems and how to apply interpolation algorithms to create impressive effects such as dust clouds, a smooth, following camera, floating rocks, and parallax scrolling for mountains in the background. Using special effects will spice up the appearance of your game.

Chapter 9, Screen Transitions, introduces screen transitions. We will dive into enhanced visual effects using OpenGL's Framebuffer Objects for off-screen rendering into video memory. This will allow us to create seamless transitions for an improved user experience while switching from one screen to another. For Canyon Bunny, we will create a variety of transition effects.

Chapter 10, Managing the Music and Sound Effects, will walk you through a list of recommended sound generators and discuss their differences. Then, we will take a look at the LibGDX's Audio API and demonstrate how to use it by creating an audio manager. We do this so that handling our entire audio playback needs become a breeze.

Chapter 11, Advanced Programming Techniques, introduces you to some advanced programming techniques that will guide you to the next level of game programming. We will build basic knowledge about the Box2D API that enables us to create believable physics simulations in games. Additionally, we will discuss the topic of shader programs with the example of a monochrome image filter effect. Lastly, we will show you how to make use of the accelerometer hardware that is commonly available in modern smartphones and tablets, which allows controlling the game by tilting the device.

Chapter 12, Animations, explains how to polish the game by adding animations. In this chapter, we will cover two different approaches to animate the game menu and the game world. Finally, we will implement a state machine to allow event-based animations for the player character.

Chapter 13, Basic 3D Programming, introduces the new LibGDX's 3D API. You will learn how to use the 3D API to create basic models such as sphere, cube, cylinder, and so on, and load models exported from modeling software such as Blender. You will also learn about ray picking, an important concept used to develop first person shooter games.

Chapter 14, Bullet Physics, will walk you through the basics of 3D physics using Bullet. Finally, we will create a simple application to simulate physics using Bullet.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.160.181