UPDATE: This sample has been updated for Silverlight 2 beta 1. See it in action here – now with heads! :)
I’ve updated my Silverlight 1.1 2D physics sample for the latest Silverlight alpha refresh:
There were several breaking changes in there, so here’s a summary of what I needed to do (might help someone trying to do the same):
- I needed to re-create my projects in VS2008 beta 2. For some reason, even though VS could compile everything happily I got obscure runtime errors (I’m pretty sure I saw a “file not found” in there). Creating new projects and dragging the source files across fixed it nicely.
- Calling the Storyboard’s Begin() method threw an unhelpful exception. This was resolved (after googling) by giving the DoubleAnimation inside it a target control (set the Storyboard.TargetName and Storyboard.TargetProperty; it doesn’t really matter what they point at).
I’ve also updated it to use the latest BulletX physics source and made the environment a little more interesting .
The animation still seems to stutter slightly. I’d appreciate it if anyone can tell me how good/bad it runs on a Mac! (assuming the 1.1 refresh is available). Also, the wheels can occasionally become stuck in mid-air when you move the platforms. This is related to optimizations in the physics engine (or perhaps it’s just “art” holding them there). It’d be easy to fix, but I kinda like it…