News for hackers. Stuff that matters.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by chunkyslink on Thursday August 05, 2010 @11:26AM (#1578331)
Great game and great code.

daleharvey - your javascript is a pleasure to read sir. I'm trying to learn js/canvas more and its good quality stuff like this that really helps.

Well done.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @12:04PM (#1578445)
Thanks that is really nice to hear.

I have spent a long time writing some really big applications with javascript and still find it such a strange language, every time I think I have found "the style" I hit a reason why I shouldnt be doing it that way, luckily its really fun at the same time.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by heyadayo on Thursday August 05, 2010 @01:57PM (#1578769)
You've got me curious: What type of big js applications do you spend that time writing? Anything game related, or is this purely a hobby?
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @02:06PM (#1578790)
I was a cofounder of an online spreadsheet company funded by seedcamp, the ui was entirely in javascript(15+kloc), and I have some chat clients + some other things that arent complete.

The game stuff is purely a hobby (for now), they are quite fun to play and to program, and I learn a lot from it.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by charliepark on Thursday August 05, 2010 @11:05AM (#1578242)
Well done. Have you considered submitting this to the 10K contest? (http://10k.aneventapart.com/)
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @11:16AM (#1578291)
Thanks I hadnt noticed that contest, It should certainly be able to squeeze into 10k
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by roofone on Thursday August 05, 2010 @01:43PM (#1578737)
Fun game and great proof of concept, though the aerodynamics aren't very realistic and whenever I've flown a helicopter through a cavern it's never never seemed that quite that blocky.

Neat easter egg at the end though.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by btw0 on Thursday August 05, 2010 @11:21AM (#1578317)
Shameless plug: also check out my "floor" game, it's written in processing.js.

http://nuwa.madk.org/game/floor.html

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by Empedocles99 on Thursday August 05, 2010 @11:22PM (#1580093)
Shameless indeed. Your game doesn't seem to work in firefox (or at all) from what I can tell.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by zavulon on Thursday August 05, 2010 @11:08AM (#1578256)
You need to tweak the speed - this is completely unplayable on my Macbook with 4GB of RAM and an SSD hard drive. Copter crashes in a second before I can do anything. But looks cool!
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by parfe on Thursday August 05, 2010 @11:12AM (#1578275)
You click and hold the mouse button to gain altitude

You release to descend.

Sounds like you aren't using the controls correctly. My first time up I just clicked once and my copter fells to a speedy death.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by zavulon on Thursday August 05, 2010 @11:15AM (#1578289)
I realize that, that's what I've been doing. Maybe I'm just slow, and don't like action games.. the only games I've ever really liked are turn-based RPGs, strategy, and adventure.. so I'm probably not the target audience for this anyway.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by endlessvoid94 on Thursday August 05, 2010 @12:27PM (#1578509)
I'm having the same problem. When I just tap the enter key, the copter shoots up into the ceiling. Way too quick to control.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @11:22AM (#1578320)
thats strange, its a fixed and low framerate and it isnt maxing any cpu so it shouldnt really get any faster on a faster machine.

I have been told between this and pacman that I make the games a little fast, but I do like them on the fast side.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by davidw on Thursday August 05, 2010 @12:28PM (#1578512)
I think it's a little disconcerting that you basically have to keep the button held down as you start or you crash.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by demallien on Friday August 06, 2010 @04:40AM (#1580561)
For what it's worth, I've tried this in Safari 5 on my Mac, and Chrome on my linux box, and it is indeed the same speed...
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by teamonkey on Thursday August 05, 2010 @04:11PM (#1579185)
Is there any technical reason for the 19fps framerate or is it just something you used to balance the speed?
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @04:27PM (#1579244)
Yeh I started it at 30fps and it was nice and smooth, but as it got harder I needed to slow it down, 19fps was the slowest that didnt look terrible, just reminded me to fix up the code so I can speed up fps while slowing down the play, it was running 30fps with no problems or lag.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by j79 on Thursday August 05, 2010 @12:36PM (#1578539)
Which browser are you using? The speed is vastly different for me when I play this in Chrome vs FireFox...
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by gtjrossi on Friday August 06, 2010 @10:28AM (#1581102)
Nice! It's a bit fast, but fun. Coincidentally, I just finished my version about a week or two ago. I used SVG, HTML5, CSS3-Fonts, etc. Check it out:

http://www.jacobrossi.com/tech/helicopter/index.xhtml

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by jbhelms on Friday August 06, 2010 @01:59PM (#1581773)
Your game crashed my FireFox, FYI.

Version 3.6.8 On Windows 7 64 bit

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by gtjrossi on Sunday August 08, 2010 @01:47AM (#1584919)
I just tested it in 3.6.8 on Win 7). No crash for me. Though Firefox has a hard time rendering it (~30FPS, or about 1/2 the frame rate of Chrome, IE9 Platform Preview 4, Safari, or Opera!). Try another browser perhaps ;-)

Also, if you have a lot of add-ons/plugins it could make it even slower (some of these try to modify the page every time it changes).

If you get any error codes, I'd love to know the details! Thx

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by stuaxo on Thursday August 05, 2010 @11:35AM (#1578353)
Holy fuck, that is difficult, played for a little bit and got 366.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by eru on Thursday August 05, 2010 @11:53AM (#1578408)
I got something similar, too. (Then I tried again and got something slightly over 800m. The tunnel is getting smaller.)

If you like the concept, you should also have a look at Canabalt (http://adamatomic.com/canabalt/).

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by thegingerbloke on Friday August 06, 2010 @04:35AM (#1580553)
Nice!

I once had a go at making the same thing:

http://petegoodman.com/labs/js-canvas-copter/

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by bitwize on Thursday August 05, 2010 @02:34PM (#1578888)
My HTMLcopter goes schwaa schwaa schwaa schwaa schwaa...

Nifty game. Gravitational acceleration constant should be tweaked so my HTMLcopter doesn't go CRASH because I wasn't ready for the game to start. Great proof of concept nevertheless.

Here's one I wrote (but was "designed" by Shinji Kobayashi, a humorous character of mine):

http://www.parodycheck.net/shinji/cannon/

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by Qz on Thursday August 05, 2010 @02:38PM (#1578902)
I couldn't control it with the mouse reasonably at all, control seemed laggy compared to enter key.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by stcredzero on Thursday August 05, 2010 @03:44PM (#1579090)
For some reason, I was able to control it with the mouse for 6 seconds, then it became too laggy and also had to use enter.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by shortformblog on Thursday August 05, 2010 @12:54PM (#1578599)
This is addictive in the way Canabalt is. Well-played, sir.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by j79 on Thursday August 05, 2010 @12:43PM (#1578563)
Fun game and impressive script!

Personally, the game was too fast (speed wise) in Chrome. However, FireFox and Safari 5 played at a much more reasonable speed.

While, I was expecting the speed to be a bit slower in FireFox, I was curious about the difference between Chrome and Safari (a V8 vs SquirrelFish difference...??)

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by fungi on Thursday August 05, 2010 @09:52PM (#1579957)
> javascript:alert(Heli.FPS=10);

obviously just swap 10 for your desired FPS

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by phreeza on Thursday August 05, 2010 @11:58AM (#1578423)
I remember playing a game like this back in 2001 on my Palm. I think it was called SFCave. Very addictive.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by jws on Thursday August 05, 2010 @05:46PM (#1579461)
For @font-face in canvas, I find that if I use the font on a page element, and defer my drawing until onload() it works reliably. Not ideal, but workable.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by frou_dh on Thursday August 05, 2010 @11:11AM (#1578272)
I got a version of this helicopter game for my iPhone (iCopter) over a year ago and I still play it. It's mysteriously addictive.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by jokermatt999 on Thursday August 05, 2010 @12:21PM (#1578491)
The version I found for Android is called ThrottleCopter, if anyone else wants to destroy their productivity. It appears to be a fairly faithful port of the common flash version I've seen (blue helicopter, green cave), although with better hit detection. My best so far is 23470.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by Keyframe on Thursday August 05, 2010 @11:30AM (#1578347)
Never thought I'd say this so soon, but this HTML5 game is too fast. Great game/code though. Now we need a 3D tunnel version.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by fungi on Thursday August 05, 2010 @09:53PM (#1579960)
> javascript:alert(Heli.FPS=10);
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by edwardoka on Friday August 13, 2010 @11:43AM (#1601214)
This reminds me that I should really get my finger out and finish some of my HTML5/Canvas experiments at some point.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by malkia on Thursday August 05, 2010 @01:42PM (#1578735)
Woohoo 410meters after 5 plays (probably not much).

The instructions should say HOLD enter key, not PRESS.

Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @02:07PM (#1578793)
Thank you are right, updated
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by malkia on Saturday August 07, 2010 @03:40AM (#1583243)
722m :)
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by w1ntermute on Thursday August 05, 2010 @12:57PM (#1578609)
Your games don't load in Chromium from the dev channel, could you please fix that?
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by daleharvey on Thursday August 05, 2010 @12:58PM (#1578615)
I will check it out. strange that any of the feature tests would be failing.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by w1ntermute on Thursday August 05, 2010 @02:00PM (#1578774)
I'm on Linux btw, that might be part of it too.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by simondo on Thursday August 05, 2010 @06:33PM (#1579568)
Seems I do much better if I hum the Airwolf theme tune. How does that work?
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by Pistos2 on Thursday August 05, 2010 @08:21PM (#1579797)
It works quite well under Opera 10.61.
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by Tichy on Thursday August 05, 2010 @06:01PM (#1579490)
Can't see it on my Nexus One. Too bad
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by spoiledtechie on Thursday August 05, 2010 @12:15PM (#1578476)
what are the keys? it didn't seem to work with the arrows???
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by adammichaelc on Thursday August 05, 2010 @12:18PM (#1578482)
Enter
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by morphir on Thursday August 05, 2010 @02:24PM (#1578857)
for reference, my personal record: 693m
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by lubos on Friday August 06, 2010 @02:42AM (#1580398)
I beat you, 1017m
Re:Helicopter Game using HTML5 (Canvas / font-face etc) by graphene on Friday August 06, 2010 @10:00AM (#1581012)
1106 :-)

My productivity, on the other hand, seems to have gone firmly into negative territory...