Skip to content

Collision Series 2 2D Per Pixel Collision

Simon Jackson edited this page Sep 2, 2016 · 8 revisions

#Collision Series 2: 2D Per-Pixel Collision#

Area Games: 2D Graphics, Games: Collision Submitted 5/24/2007 Tutorial


Description:

This tutorial details how to perform per-pixel collision detection in two dimensions. This tutorial builds on the previous tutorial in this series, Collision Series 1: 2D Rectangle Collision. Follow the steps in that tutorial before starting this tutorial.

Tutorial Overview

In the previous example, you created a simple object avoidance game by using rectangle collision detection. The rectangles used were only an approximation of the blocks and person drawn into the textures. You may have noticed that the exclusive use of rectangles resulted in imprecise behavior for nonrectangular objects.

Other items in the Collision Series:

[Collision Series 1: 2D Rectangle Collision](https://github.com/DDReaper/XNAGameStudio/wiki/Collision Series 1 2D Rectangle Collision)

[Collision Series 3: 2D Collision with Transformed Objects](https://github.com/DDReaper/XNAGameStudio/wiki/Collision Series 3 2D Collision with Transformed Objects)

[Collision Series 4: Collision with a Heightmap](https://github.com/DDReaper/XNAGameStudio/wiki/Collision Series 4 Collision with a Heightmap)

[Collision Series 5: Heightmap Collision with Normals](https://github.com/DDReaper/XNAGameStudio/wiki/Collision Series 5 Heightmap Collision with Normals)

All content and source code downloaded from this page are bound to the Microsoft Permissive License (Ms-PL).

XNA_Collision2_PerPixel_01_small.jpgXNA_Collision2_PerPixel_02_small.jpg

downloads

PerPixelCollisionSample_4_0.zip

Size: 0.04MB

Source code and assets for the Collision Series 2: 2D Per-Pixel Tutorial (XNA Game Studio 4.0).

Clone this wiki locally