alwayschillin.net Blog chillaxin’ til’ the day i die…

23Apr/081

XNA Follow A Path

I was dabbling in the XNA documentation, and came across the Curve class. I had seen it a couple times before but never really went into it much. But I was looking for something new to do so I got into it and converted the Curve3D class created in the XNA Documenation to a Curve2D class, and added a wrapper class called Path2D which uses to the Curve2D class to travel a long a pre-defined set of points. The Curve2D class itself is very usable by itself, but the Path2D class brings it into a package where you could add it to your Sprite class and let it move around all cool-like on the screen. I also added a couple extra functions for making new paths, and timing how it may take to travel it.

 followpath2d_screenshot

Download it here: http://alwayschillin.net/downloads/FollowPath2D.zip

Enjoy!

Filed under: xna Leave a comment
Comments (1) Trackbacks (1)
  1. Curves are great, aren’t they?


Leave a comment