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…

8 responses so far ↓
Silverlight Cream for August 6, 2007 // August 6, 2007 at 4:06 pm |
[...] layout controls to Alpha 1.1 Refresh; and Michael Washington continues with DNN and Silverlight Silverlight 1.1 2D Physics sample updated Chris Cavanagh has updated his 2D Physics sample to 1.1 latest and added a few more enhancements as [...]
H32 // August 6, 2007 at 4:28 pm |
Sould this Version run with the 1.0RC?
If so, then you should update the silverlight.js, as Opera now supports Silverlight, but isn’t recognized by the bad browser-detection.
Chris Cavanagh // August 6, 2007 at 8:39 pm |
H32 – I’ll check the Silverlight.js; I’m pretty sure it’s the latest (says 1.1 refresh in the comment) but let me know if there’s a better one to use. Had a strange thing happen a couple days ago where browsing to the page just showed the “Get Silverlight 1.0″ button; reinstalling the 1.1 alpha refresh seemed to fix it. Anyone else seen this?
Martin Cook // August 7, 2007 at 5:03 am |
Chris,
I get the following “un”-useful error: -
Silverlight error message
Error Code: 1001
Error Type: ParserError
Message: AG_E_UNKNOWN_ERROR
XamlFile: Page.xaml
Line: 8
Position: 9
Martin
Chris Cavanagh // August 7, 2007 at 7:00 am |
Martin – Yep, I’ve seen many like it
Not sure why we’re having so many issues with this refresh release. What OS are you running on, and which version of Silverlight do you have? It might help to try re-installing the 1.1 refresh and try again (somehow it worked for me a couple days ago; don’t have a good explanation why yet…). Thanks!
Chris Cavanagh // August 7, 2007 at 7:01 am |
H32 – This definitely won’t work with just the 1.0RC; it’s using managed code in the physics engine, which needs the Silverlight 1.1 alpha refresh (even the earlier 1.1 alpha won’t work).
Keith Peters // December 14, 2007 at 2:17 pm |
Here’s some Mac feedback:
I can’t get it to run at all on FireFox. The html source looks fine, but I just get a blank page (yes, I have 1.1 installed and can see other 1.1 content on Firefox).
I can see it on Safari, but the stuttering is unbearable. It’s not even really stuttering, as it is stopped as much as it is animating.
I’ve been trying to do some similar animations, and have been plagued by this stuttering issue too, so I’d be really interested to know if you solve it.
Chris Cavanagh // December 14, 2007 at 2:34 pm |
Keith – Interesting about FireFox issues… yet it “works” in Safari? Weird… maybe it’s one of SL’s known issues and will be fixed for 2.0?
Yes the stuttering sucks, but I think that’s largely my doing
I’ve written several other SL 1.1 apps (can’t blog about them… yet at least) with a lot going on and no stuttering. I really need to revisit this demo and clean it up.
I’m happy to help you fix the stuttering you’re seeing. Paste or mail me some code and I’ll take a look