Cube Defense! (WebGL TD Game) | November 6th, 2009
This is a playable demo of a game I’ve been working on with WebGL. As per usual, this will only run in WebKit Nightlies build. No bias or anything, but WebGL runs too slow for the game to work in FireFox Minefield. (It will work in both WebGL enalbed WebKit and Firefox, but WebKit will perform better.) This is also my first take on trying to make a tower defense style game, so don’t expect too much.
November 6th, 2009 at 7:33 am
Wow.. that is pretty damn cool Yohei. wow. If you could just work Chuck Norris into that.. it would be perfect.
November 6th, 2009 at 7:58 am
[...] This post was mentioned on Twitter by Shazron Abdullah and Fil Maj, rob_ellis. rob_ellis said: HOLY COW - Check out this WEBGL Demo Yohei put together 3d Tower Defense http://blogs.nitobi.com/yohei/?p=62 #webgl #nitobi #awesome [...]
November 6th, 2009 at 8:08 am
Congrats! This is the first really playable WebGL game I’ve seen.
The interface for placing the towers seems a little confusing, but it works!
November 7th, 2009 at 2:15 pm
There’s a bug in selling towers; it will also remove all towers after the selected tower in towerArray. You should use towerArray.splice(currentIndex, 1);
November 9th, 2009 at 1:31 am
[...] Shimomae has come up with another excellent demo, a game called Cube Defense. Sadly it’s WebKit-only — it works on Chrome and presumably Safari, but not on Firefox [...]
November 11th, 2009 at 11:44 pm
[...] been some nice progress around the web as well, most recently with Yohei Shimomae’s Cube Defense, a tower defense like game built with JavaScript and WebGL - probably the first WebGL game [...]
November 12th, 2009 at 2:48 pm
[...] been some nice progress around the web as well, most recently with Yohei Shimomae’s Cube Defense, a tower defense like game built with JavaScript and WebGL - probably the first WebGL game [...]
November 13th, 2009 at 6:16 am
Works for me in Firefox under Linux.
Latest trunk as of 10 minutes ago
November 16th, 2009 at 2:52 am
[...] by our reader Nox. Just like similar games, you have to build towers and defend yourself. Author recommends running it on latest WebKit nightly builds, as WebGL might run slow in other web [...]
November 16th, 2009 at 10:22 am
This is not working for me…
WebKit Nightly r50918, Safari 4.0.2 (5530.19, r50918).
I get: ReferenceError: “Can’t find variable: CanvasFloatArray” in in utils3D.js at line 163
OS X 10.5.8, build 9L31a.
November 18th, 2009 at 7:46 am
I just updated it so it should work in the latest WebKit now.
December 3rd, 2009 at 3:37 pm
Just to let you know man, I get some error when I try to play this video … My browser is FF..
Cheers
December 17th, 2009 at 11:16 am
Hey. Just wanted to mention a couple of odd bugs. Was going to visit your website but it is some flash thingy that does not degrade gracefully in w3m (all I can use right now), at all.
1) almost immediately after initial edit/creation of a tower I get a grey tower radius superimposed on the game for the rest of the game, whatever I do
2) I was doing some rapid building of towers when screwing around on lvl 1 and somehow I got $.5
The screenshot below shows both of these issues. The 2nd smaller circle is the bug circle.
http://m8y.org/tmp/cube_defense_alpha_bug.png
Apart from that, awesome demo, way cooler than the stuff in:
http://khronos.org/webgl/wiki/Demo_Repository
BTW, that game in the screenshot is still running. I’m curious how long it will take them to overrun the defenses. Right now they are on wave 143 and I have $17,351,167 to spare.
BTW, so awesome to be able to edit/copy the text portions. I like how you overlaid HTML on it like that.
December 18th, 2009 at 9:55 am
The grey circle is remaining from editing, and can be dismissed on certain circumstances. It appears to just be an artifact.
The simple solution would be to make sure it is hidden when editing is complete.
Another odd bug, at least in Firefox nightly, is the bullets “twitching” as they flight out in space, their coordinates jerking a bit.
At this point I’m just curious how far the first round can go, and what will happen as the numbers get large.
Phase 214
Life 6
$ 601158838
Bonus 5%
Score 943180
December 18th, 2009 at 9:57 am
Ah. The .5 was most likely from selling… Nevermind.
December 22nd, 2009 at 12:38 pm
[...] voir des expérimentations d’applications en 3D temps réel dans le navigateur comme ici avec Cube Defense : Un jeu de tower defense dans votre navigateur avec [...]
December 29th, 2009 at 4:44 pm
Heh. Still watching this game suck up my CPU out of curiosity…
Phase 475
Life 6
$ 205405585683149
Bonus 5%
Score 4560340
BTW, another bug I’ve noticed, on and off, past few days is sometimes the shapes seem to get “stuck” on either bends in the path or edges of cubes. They kind of jitter there without moving until they are destroyed.
January 8th, 2010 at 3:30 pm
Phase 614
Life 6
$ 181102692892726700
Bonus 5%
Score 7606000
The attackers that get stuck are almost always the light blue. They either keep bouncing forever at the first bend, or else at the edge of the cube face.
Maybe the movement increment is large enough because they are so speedy that it keeps triggering a collision check that kicks them back, and they keep repeating it forever.
January 22nd, 2010 at 10:26 am
Just kind of watching out of curiosity to see if the game can ever end.
Anyway, here’s a screenshot of stuck attackers.
http://m8y.org/tmp/cubedefense.png
In order to see the ever inflating currency, ran following:
javascript:var x=document.getElementById(”hud”).getElementsByTagName(”div”)[0];x.style.width=”230px”;var y=x.getElementsByTagName(”div”)[6];var z=x.getElementsByTagName(”div”)[0];z.style.width=”50px”;y.style.width=”165px”;void 0
Otherwise the game hasn’t been touched in a month.
January 25th, 2010 at 6:34 am
[...] been some nice progress around the web as well, most recently with Yohei Shimomae’s Cube Defense, a tower defense like game built with JavaScript and WebGL - probably the first WebGL game ever but [...]
January 25th, 2010 at 10:07 am
Well, about 5 weeks later, they finally broke through.
Phase 773
Life 0
$ 423665851676042900000
Bonus 5%
Score 12027900
September 15th, 2010 at 6:28 pm
Phase 753…dang it Nemo beat me!
October 24th, 2010 at 8:36 pm
Well, is this not supporting?? It doesn’t work on chromium or firefox… T.T