
HTML 5 Asteroids - gr366
http://dougmcinnes.com/html-5-asteroids/
======
ck2
Oh heck, there goes my next hour.

Wow that's fantastic. Now someone make Missile Command.

Pegs my CPU though (Firefox and Chrome)

Open source too: <http://github.com/dmcinnes/HTML5-Asteroids>

update: I tried a few flash versions on the web to compare

sorry to say they use a fraction of the CPU, at least under Flash 10.1rc4

~~~
jrockway
_Pegs my CPU though (Firefox and Chrome)_

I assume this is to intentionally maximize the framerate. ("renice" is your
friend if you have something more important to do in the background.)

------
buster
It shows very good why it's not ready to ditch Flash completely.

I mean.. that's asteroids, i have a Core2Duo, 4GB RAM, 1024MB graphicscard und
the asteroids are not smooth, they are flickering a little...

~~~
billswift
I have a two and a half year old AthlonX2 with only 256 MB RAM and have no
problems with it. Plus I am on dial-up, and this loads _much_ faster than
Flash.

~~~
buster
I mean the animations are not smooth, it's probably the algorithm that rotates
the asteroids, but well.. if noone can see that, i may be more sensitive about
it, but it was the first thing i noticed.

------
ZeroGravitas
Surely SVG makes more sense for vector games?

They should also try to recreate the arcade experience with the painted
backgrounds, like from here:

<http://mameworld.info/mrdo/mame_artwork/astdelux.png>

~~~
pohl
Honest question here...

Why would SVG make more sense than canvas? Doesn't Canvas use a similar vector
drawing model that you find in Postscript, Java2D and SVG? It seems to me that
the main difference between the two is that one is an API and another is
markup. So what makes SVG more suited for vector games?

I would think needing to have objects for each element in the SVG's XML would
be unnecessary overhead, and wouldn't really buy you anything in return.

------
philwelch
On a Mac Core 2 Duo MacBook with Safari, it stays below 45% CPU and is smooth
as silk. This is actually better performance than Flash.

~~~
ilike
I would like to know what Flash game are you comparing this simple game with.

~~~
maukdaddy
Doesn't matter. ALL flash pegs my MacBook Pro CPU >50%, most of the time > 90%

~~~
joubert
yeah, even ads!

------
renewableGuy
Cool. But the game is very sluggish and almost non playable on iPad. I wish
these html5 games were built with some consideration for iPad.

Anyway, i really appreciate the effort. One step closer to a flash-less web.

~~~
jasonlotito
Maybe the iPad should be built with some consideration for the web? The web
shouldn't be built with consideration for a single device. The game is HTML5.
Fine. The iPad obviously has performance issues with that. That's the iPad's
problem. Apple didn't want Flash, they wanted HTML5 and standards. Now they
have to pony up.

But no, the iPad should conform to standards, and support those standards. If
the iPad is not capable of supporting those standards in a usable manner, it's
the iPads problem.

~~~
joubert
I agree with both you and the parent. One of the problems with many sites is
the expectation that there is a (dedicated) keyboard on the device that is
browsing.

I think when one designs something like this, take cognizance that more and
more devices have virtual keyboards.

------
RyanDScott
The Render Engine also has a nice demo up--I prefer its nifty particle
explosions and rocket exhaust. I believe this uses the HTML5 Canvas.
[http://renderengine.googlecode.com/svn/trunk/demos/spaceroid...](http://renderengine.googlecode.com/svn/trunk/demos/spaceroids/index.html?evolved=true)

------
cubicle67
I made a canvas variant of asteroids about a year ago. It's not up any more,
but does anyone here remember it? The game over screen told you you'd died of
dysentery

Edit: Hey! I found it :) <http://users.tpg.com.au/_dp/dave_asteroids.html>

------
wazoox
That's great, but it existed as a DHTML demo for Internet Explorer 4.0 10
years ago. So much for the hype.

~~~
ck2
1996 actually, so 14 years, wow (when did I get old?!)

[http://samples.msdn.microsoft.com/workshop/samples/dhtmltech...](http://samples.msdn.microsoft.com/workshop/samples/dhtmltechcol/dndude/asteroids.htm)

Only works in IE though.

------
aw3c2
Works very well with Opera too.

~~~
Pistos2
Yep. Over here, Opera 10.53 on Linux, on an Athlon X2. Uses about 75% of one
of the CPUs. I'm impressed that I can hold any combination of the game-playing
keys, and it doesn't falter (thrust + turn + fire). The framerate holds, and
everything looks and behaves smoothly, with great responsiveness.

------
pellicle
Needs audio! But very cool indeed.

------
joubert
nice nice. can you texture map the objects?

