in

This site is all about the amazingly cool stuff you can do with VB.NET.

The VB.NET XNA Project

2D Collision Sample #2 (per pixel) posted

The VB.NET version of the per pixel collision sample. Grab it from the files section here!


2D Collision Sample 2: Per-Pixel

This sample demonstrates per-pixel collision detection.

Introduction

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

In order to achieve the desired behavior, the code must examine every overlapping pixel to determine if there is a collision. This is called per-pixel collision.

Comments

No Comments

About admin

Chris Williams is a Technology Evangelist for Magenic. He is the founder of several .NET User Groups on the east coast, and most recently the Twin Cities XNA User Group (www.twincitiesxnausergroup.com) in Minneapolis, MN. He is a VB.NET MVP, rabid blogger and owner of www.ILoveVB.NET. He's also a MCT, MCSD (.NET) Early Adopter, MCAD, freelance game developer, occasional author, tech editor, code camp & user group speaker, vintage arcade game collector and plays a pretty mean guitar in Rock Band.
Copyright 2008 - ILoveVB.NET
Powered by Community Server (Commercial Edition), by Telligent Systems