XNA RoundLines in Pixel Coordinate Space

Two people recently sent me questions about setting up the world/view/projection matrices to work with my XNA RoundLine code. All of my programs so far have specified line coordinates in an abstract world coordinate space, with a view matrix based on a 2D camera and a projection matrix to adjust for nonsquare viewports. But if…

1

Shadows in 2D

The discs of light used by my XNA 2D lighting code look decent, but shadows would really add to the realism. Shadows are a bit tricky because they are non-local: an object half-way across the screen can make the difference in whether a pixel should be light or dark. And you have to take account…

0

BentMaze 1.2: Lights Out!

I’ve been playing with 2D lighting lately so I can add it to my XNA maze game. Lighting in computer graphics, I think it’s fair to say, is always a bit of a hack — a matter of finding some middle ground between the (incredibly rich and complex) way light behaves in the real world…

1

BentMaze 1.1: Collide and slide

Man, I totally jinxed myself when I predicted that hooking up my RoundLine collision detection / sliding code to my XNA maze game wouldn’t be painful. It was. But after a lot of hours of debugging, I’ve got it working well enough to call done and usable, though not perfect. The main problem arises because…

1

Collision and wall sliding on a RoundLine

I think I’ve got it! After a couple hours of head-scratching and geometry, my XNA code to handle collision between a disc and a RoundLine is looking correct — at least in my test app. Soon my maze game will be a bit more challenging, since the walls will be impenetrable. Okay, so there’s a…

2

Graphing the distance to a RoundLine

The next thing I want to add to my XNA maze game is collision detection, so my little orange disc can’t go right through the maze walls. There seem to be two alternate general approaches that can be taken regarding collision detection: After reading the user input, determine whether moving the disc the way that…

1

BentMaze 1.0: A jittered maze and radial culling

One natural fit for my XNA line drawing code is a maze game, since mazes consist of lots of thick lines, and they are easy to generate programmatically. So I had a look at some maze generation algorithms, decided to try the simple depth-first algorithm, and had myself a maze. My original implementation of the…

3

Microbe Patrol 1.1: Xbox 360 support

I’ve updated my Microbe Patrol XNA project to build for both Windows and the Xbox 360.  I didn’t make any other changes to the game, so if you don’t have an Xbox 360 and a Creator’s Club subscription, you might not find it worthwhile to upgrade to this version. I used the “two projects in one solution”…

1

Microbe Patrol 1.0: An actual XNA game, finally

I’m finally done writing an XNA game called “Microbe Patrol” based on the Microbes sample I wrote and blogged about, around a month ago. I think it turned into a fairly fun, original, good-looking game. The basic concept of the game is to create trails from one point on the arena’s perimeter to another, without…

3

Stroke-based text rendering in XNA

There are some nice texture-based solutions out there for drawing text in XNA. I’ve used the font code in XNAExtras a couple times, and it works fine. There’s another font utility on Ziggyware that looks nice, and I believe there are others too. There’s also talk of an official font solution being added to XNA at…

3