Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 17 Collision and Simple Physics

CHAPTER 17
COLLISION AND SIMPLE PHYSICS

by Mike McShaffry

image

Even the simplest 2D game needs collision. After all, if the objects in a game can’t interact, how fun could the game possibly be? Breakout is a great example of a simple game. A ball bounces off walls, bricks, and the paddle. If you look at it this way, the core of the game experience is created by the 2D collision algorithm. It’s almost impossible to design a game without at least some rudimentary collision. Perhaps a text adventure like Zork is one example, but hey, it hasn’t exactly been flying off the shelves lately. If you are familiar with Zork, that’s great because you know your game history. If you’ve actually played Zork, well, then you are probably as “mature” as I am.

Collision is a purely mathematical calculation to determine the spatial relationship between objects such as points, lines, planes, or polygonal models. I’ll point you to some great resources outside of this book that provide good solutions. I’m not going to pretend I can offer something better.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial