Transformed Collision
Ported from Microsoft's XNA 4.0 2D Collision Tutorial 3: Transformed.
Source for this sample on GitHub ↗
Play ▸
Opens in a new tab. Click the canvas so it receives keyboard input.
About this sample
Move the person beneath falling, rotating spinner blocks. A collision turns the background red only when the visible pixels touch. The game first checks a bounding rectangle, then tests the transformed pixels inside it.
Controls
| Action | Keyboard | Gamepad |
|---|---|---|
| Move person | Left / Right arrow | D-pad left / right |
| Exit | Esc or close the tab | Back |