Skip to Content
Programming 2D Games
book

Programming 2D Games

by Charles Kelly
June 2012
Beginner
438 pages
15h 26m
English
A K Peters/CRC Press
Content preview from Programming 2D Games
6
Collisions and Entities
In this chapter, we will add a new Entity class to the game engine. One of the new features
of the Entity class is the ability to collide with other entities. In addition to colliding,
entities will also have the ability to react to collisions. e code for collision detection and
reaction will be part of the Entity class. Many of the calculations we need to perform for
the collision code will use vectors and vector math, so we will start this chapter by taking a
look at vectors.
6.1 Vectors
A vector represents both length and direction. We will dene a vector by the x and y coor-
dinates of its end point. DirectX has D3DXVECTOR2 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning 3D Game Programming

Beginning 3D Game Programming

Tom Miller

Publisher Resources

ISBN: 9781466508705