682 karma · joined August 21, 2007
edit: My mistake. It detects when you're using the eraser, but that's it.
edi2: Actually some of the brushes do seem to be pressure sensitive but it doesn't seem to work on all of the brushes it should.
From my experiences with canvas it seems the calling the drawing methods is the major bottleneck for this sort of thing. Minus the visuals I would guess the JS on V8 would run comparably to the AS3.
For comparison: http://blog.inspirit.ru/wp-content/uploads/fluidsolver/Main.... - a much more complicated algorithm running with more particles and additional visual effects, and it runs more smoothly (although admittedly this does use 10-15% more CPU on my machine, still I don't believe the same thing implemented with canvas would run nearly so well).
Not sure when the release is due though.
An aside, bizzarely I find it's often faster to redraw some graphics "vector style" (calling the lineTo/bezierCurveTo etc methods again) on canvas than it is to use drawImage and use a cached version of the same graphics.
I don't expect to see any kind of Actionscript combined export any time soon though, performance is too much of a hurdle in the near future.
This is also why some movies seem to hog an undue amount of resources, to ensure it feels as responsive as possible people use excessively high framerates when they're not needed.
There is a mechanism for forcing render updates between the usual frame timer but in my experience most people don't seem to understand it, so it's rarely used.
The one slightly misleading thing about this test case is I'm pretty sure canvas would fall behind quite quickly with a scene with more complicated shapes (understandably so, you have to call JS functions to redraw everything every frame, whereas in Flash you could draw once and then move objects around and let the renderer deal with it without the overhead of calling the drawing functions every time).
Maybe I should post a link to my stuff when I get around to working on it some more!
My point was canvas isn't quite there yet, not that it never will be, and also that I think the Flash-has-an-editor argument isn't the reason why canvas isn't ready yet.
As a side note, I'm already one of the people writing a library/framework to overcome the things I mentioned, the problem is I don't think it's going to be fast enough to do much with for a while.
I've tried using canvas to replicate some things that we've made in Flash, and quickly ran into some problems:
1) There is no way of interacting with elements drawn to canvas, as it's just a flat image (as someone else mentioned in the comments here, canvas is just a way of drawing bitmaps). You could obviously write your code to deal with mouse and keyboard interaction, but it's even more overhead on something that is already quite slow, and even if you could interact with individual elements it brings me to the other thing...
2) Flash has everything in layers that can be updated independently, when it comes to canvas if you want to change something you have to redraw that section of the image entirely, something that isn't always practical which means you end up redrawing the whole canvas. Essentially Flash does the same thing, but as the compositing is handled by the plugin it is far faster than anything you can do in Javascript at the moment.
Also related to the above, the drawImage method that draws bitmap data to the canvas is painfully slow at the moment, so compositing using that is out of the question. If that can be optimised significantly it will certainly help.
Basically canvas is too low level to duplicate the kind of functionality Flash offers at the moment. Until manipulating the canvas and Javascript is optimised further it's not possible to layer in the interaction or flexibility of rendering that Flash has. I'm sure a framework offering this will happen one day, but it won't be any time soon.
edit: Oops, I didn't mean to reply to your message. The game story is a bit of a jumble. You start by chasing this arms dealer (The Jackal mentioned in the article) but spend at least 2/3rds of the game running errands for two factions in a civil war (they both offer you missions and you can choose which to accept). I've tried playing it twice but never made it too the end, it gets a bit monotonous by hour 20. That's mainly because you don't care about your foes or allies in the game. Unlike the author of the article, I ascribe that to completely uncompelling and irrelevant storytelling rather than careful manipulation.