O'Reilly logo

Developing Games in Java™ by Bret Barker, David Brackeen, Laurence Vanhelsuwé

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

Chapter 11. Collision Detection

KEY TOPICS

  • Collision Basics

  • Object-to-Object Collisions

  • Object-to-World Collisions

  • Basic Collision-Detection Demo

  • Collision Handling with Sliding

  • Collision Detection with Sliding Demo

  • Enhancements

  • Summary

Remember Pong?

Whether it's a pong ball bouncing off a paddle, a laser hitting a robot, an adventurer falling down a pit, the hero finding some ammo, two monsters ramming into one another, or just the player walking into a wall, you're going to need some sort of collision detection in almost any game.

In Chapter 5, “Creating a 2D Platform Game,” you made some basic 2D collision detection that worked well for a 2D tile-based game. In this chapter, you'll expand on the ideas presented there, provide more thorough object-to-object ...

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

Start Free Trial

No credit card required