O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Beginning Java Game Development with LibGDX

Book Description

Design and create video games using Java, with the LibGDX software library. By reading Beginning Java Game Development with LibGDX, you will learn how to design video game programs and how to build them in Java. You will be able to create your own 2D games, using various hardware for input (keyboard/mouse, gamepad controllers, or touchscreen), and create executable versions of your games. The LibGDX library facilitates the game development process by providing pre-built functionality for common tasks. It is a free, open source library that includes full cross-platform compatibility, so programs written using this library can be compiled to run on desktop computers (Windows/MacOS), web browsers, and smartphones/tablets (both Android and iOS).

Beginning Java Game Development with LibGDX teaches by example with many game case study projects that you will build throughout the book. This ensures that you will see all of the APIs that are encountered in the book in action and learn to incorporate them into your own projects. The book also focuses on teaching core Java programming concepts and applying them to game development.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Contents at a Glance
  5. Contents
  6. About the Author
  7. About the Technical Reviewer
  8. Acknowledgments
  9. Introduction
  10. Chapter 1 : Getting Started with Java and LibGDX
    1. Choosing a Development Environment
    2. Setting Up BlueJ
      1. Downloading and Installing
      2. Using BlueJ
      3. Setting Up LibGDX
    3. Creating a “Hello, World!” Program with LibGDX
    4. Advantages to Using LibGDX
    5. Summary
  11. Chapter 2 : The LibGDX Framework
    1. Understanding the Life Cycle of a Game
    2. Working with User Input
    3. Managing the Action
      1. The Sprite Class
      2. The Actor Class
    4. Implementing Visual Effects
      1. Value-Based Animations
      2. Image-Based Animations
    5. Introducing User Interfaces
      1. Labels and Bitmap Fonts
      2. Layering with Stage Objects
      3. Cameras and Scrolling
    6. Handling Multiple Screens
    7. Summary
  12. Chapter 3 : Extending the Framework
    1. Cheese, Please! Revisited
      1. Discrete Input
      2. Abstract Class Design
      3. Refactoring the Project
    2. Balloon Buster: A Mouse-Driven Game
      1. Balloons
      2. Adding Interactivity
      3. Next Steps
    3. Starfish Collector: A Game with Improved Actor Classes
      1. The BaseActor Class
      2. The AnimatedActor Class
      3. The PhysicsActor Class
      4. Creating the Game
      5. Next Steps
    4. Summary
  13. Chapter 4 : Adding Polish to Your Game
    1. Audio
    2. Advanced User-Interface Design
      1. Arranging UI Elements
      2. Managing Resources
      3. Using Customized Bitmap Fonts
      4. Creating Buttons
      5. Setting Up the Start Screen
      6. Creating an Overlay Menu
    3. Summary
  14. Chapter 5 : Alternative Sources of User Input
    1. Gamepad Controllers
      1. Continuous Input
      2. Discrete Input
    2. Touch-Screen Controls
      1. Working with a Touch Pad
      2. Redesigning the User Interface
    3. Summary
  15. Chapter 6 : Additional Game Case Studies
    1. Space Rocks
      1. The Spaceship
      2. Lasers
      3. Rocks and Explosions
      4. Next Steps
    2. Plane Dodger
      1. Infinite Scrolling Effects
      2. Player Plane
      3. Stars and Sparkles
      4. Enemy Planes
      5. Next Steps
    3. Rectangle Destroyer
      1. The Paddle
      2. The Brick
      3. The Ball
      4. The Power-up
      5. Setting Up the Game
      6. Next Steps
    4. 52-Card Pickup
      1. Cards and Piles
      2. Setting Up the Game
      3. Providing Visual Hints
      4. Next Steps
    5. Summary
  16. Chapter 7 : Integrating Third-Party Software
    1. Working with Particle Systems in LibGDX
      1. The LibGDX Particle Editor
      2. Rocket-Thruster Effect
      3. Explosion Effect
      4. The ParticleActor Class
      5. Starscape: An Interactive Visual Demo
    2. Using Tiled for Level Design
      1. Creating Tilemaps
      2. Treasure Quest: An Adventure-Style Exploration Game
      3. Creating Four-Directional Character Animations
    3. Simulating Advanced Physics with Box2D
      1. Physics Primer
      2. The Box2DActor Class
      3. Jumping Jack: A Physics-Based Sandbox Game
    4. Integrating Multiple Components
      1. Preliminary Setup
      2. Jumping Jack 2: Even More Coins
    5. Summary
  17. Chapter 8 : Introduction to 3D Graphics
    1. Exploring 3D Concepts and Classes
    2. Creating a Minimal 3D Demo
    3. Re-creating the Actor/Stage Framework
      1. The BaseActor3D Class
      2. The Stage3D Class
      3. Creating an Interactive 3D Demo
    4. Pirate Cruiser: Navigating the Sea in 3D
    5. Next Steps
    6. Summary
  18. Chapter 9 : The Journey Continues
    1. Continuing Your Developing
      1. Working on Projects
      2. Obtaining Art Resources
      3. Participating in Game Jams
      4. Overcoming Difficulties
    2. Broadening Your Horizons
      1. Playing Different Games
      2. Increasing Your Skill Set
      3. Recommended Reading
    3. Disseminating Your Games
      1. Packaging for Desktop Computers
      2. Compiling for Other Platforms
      3. Finding Distribution Outlets
  19. Appendix A: Review of Java Fundamentals
    1. Data Types and Operators
    2. Control Structures
      1. Conditional Statements
      2. Repetition Statements
    3. Methods
    4. Objects and Classes
    5. Summary
  20. Index