95 comments

[ 3.1 ms ] story [ 155 ms ] thread
<incorrect> And here I thought that Google had implemented PacMan in HTML5 on their logo, given their presentation at Google I/O. </incorrect>

EDIT: I didn't see that you had to click "Insert Coin" to start.

That's not what they did?
They don’t use canvas, just a lot of divs and javascript.
It's implemented with javascript and html, but they're using Flash for sound.
Unfortunately Flash is currently pretty much unavoidable if you want sound effects in JS games.

I experimented with <audio> tag in HTML5 game few days ago: it's fine for media player type applications (where you play longer sounds with looser coupling to user actions), but it's not there yet for games (implementation-wise, API is ok).

If you need to play a lot of tiny sounds in rapid response to player actions, you are going to get random weird behaviors and cross-browser inconsistencies: noticeable lags, cracking noises, cuts and repetitions.

This seems to be heavily depended on the file types you use. I have some experiments with many different, short, sound files running with <audio> just fine - in Chrome, FF and Opera at least.

Ogg Vorbis and (of course WAV) works quite nice, MP3 doesn't. For Safari, maybe AAC would be the right choice. Still, as you said, the <audio> implementation is quite buggy at times. But I have no doubt it will get better!

Yes, a good point. I confirm, also in my experience problems are very dependent on particular sound files. Some work perfectly fine, some make troubles.

And it's not just encoding, it seems to be dependent also on what's inside the sound file like a particular waveform or length.

For me the worst were a sequences of very short sounds (fractions of second) played in a direct response to rapid successive keypresses (keydown-keydown-keydown should make pew-pew-pew). No matter what I did, there was always at least one browser with some showstopping bug.

Boy, did that surprise the heck out of me. I never worry about keeping my speakers turned up when going to google.com
Apparently this is overwhelming the Firefox support forums and chat lines:

https://support.mozilla.com/en-US/forum/1/678373

Bad move by google, really. Start on a button click is one thing but auto-starting something that makes a bunch of noise on a page that has always been totally silent is really dumb.
Google doesn't autostart anything, it's a FireFox extension (Cool Previews) that loads the page in the background that causes the trouble. I suggest reading up on the real story before you start labeling things as "bad moves" and "really dumb".
Actually, the sound does autostart when you load the page. But the playing sound in the background issue is related to the extension.
My browser is 'clean', there are no extensions or plug-ins installed besides the 'closed tabs button' and greasemonkey.

Welcome to HN by the way.

Insert a second coin for Ms. Pac-Man multi-player.
That's pretty hot. WASD controls Ms. Pac.
I've no friends, so I'm just playing two-handed. Try it for an extra challenge..
Best. Logo. Ever.
Time has come for interactive Google Logos. This will be so much fun.
Wonder how many global man hours are going to be wasted by people playing this game today ;)
(comment deleted)
How is it ever a waste of time to read source code?
I just played a level with my boss. I'm disappointed it doesn't load up on the droid.
(comment deleted)
Does this imply that nobody uses the "I'm feeling lucky" button?
and saves a lot of money for Google too
I don't think so, didn't google publish that they "lose" 60 million USD or something beaues people click it and don't see ads :)
The goodwill from that is probably worth more than $60,000,000!
Google is replacing the need for the "I'm feeling lucky" button with their auto-complete system. It's the same effect as the button but is shown in the auto-complete field while the user is typing.

This has the same side effect for Google regarding ads as does the button. Although if a user wants to be taken directly to website ABC they prob aren't a good audience for ads.

I find it very useful to use as a search destination for the address bar.

For example, in Chrome, add this as one of the Search Engines in the options dialog: http://www.google.com/search?q=%s&btnI=Im+Feeling+Lucky

I've associated that with the keyword "gg"

Now, when I go to the address bar and type a query whose first Google result I am confident will be the destination I want, I've got a great way to get there.

Example:

"gg imdb Forest Gump"

Will get me to IMDB's Forest Gump page. So you can pretty much imagine the power here, especially for reference sites. Type the site name and the query, and you'll end up where you want to be.

If you want reference sites, why not just add them directly?

Most of those sites has an opensearch provider.

You should use http://yubnub.com, which will let you just type "imdb Forest Gump", among many, many, many other things.
Why? His solution automatically works for anything, and your site doesn't even appear to be up at the time of writing.
The one that appears after you start typing?
It works on the iPhone too. Type in the address in Safari, then click Classic mode at the bottom of the screen. ^_^
I found a bug... collected a pill as a previous one's time allotment was ending and it didn't register in the game.
If anybody's curious about the source, here's a reformatted version:

http://pastebin.com/enyeHeKg

thanks, just wondering what tools did you use to reformat it?
Only Google would write 3,162 lines of source code for something that would be on their site for 24 hours.

EDIT: You wouldn't happen to be Rodger from the nonlogic community, would you?

Aw, you caught me. :)

How's it shakin'?

It's going well, how about you? (my nick was canuckid by the way, which will probably bring back some bad memories?;-)
First 1000 lines are just the map and related data
Ah, but in terms of play hours divided by development hours, this is bound to trump most indie games.
You wouldn't be prepared to write 3,162 lines of code for something with a guaranteed audience of hundreds of millions of people? What does it take for you to get out of bed? Billions of viewers?
How many people played it?
Haha, they've even included a kill screen:

  g.level == 256 && g.killScreen()
Try removing ghosts with Firebug and play blind pac man!
Works on Android as well! But not BlackBerry.
I would like to see how many millions google makes by disabling the I'm Feeling Lucky button today.
Aside from no sound, it works on the iPad. They seem to be handling touch events (swipes) for movement.
Sound is played using Flash, so that's why it doesn't work.
booo! why wont it load on the droid?
Same on my Nexus One.
at least it isn't flash.

how senior did the approval have to be to get this allowed, do you think?

I think we are all missing the point, that its <b> Pac-Man's 30th anniversary </b>. But yes the playable logo, just adds to the awesomeness
May be Google will dish out there own anti spyware & antivirus for chrome next.

I liked the plain old google page .. simple

Would be awesome to see a high score list.
I love pacman, but still the game should NOT start automatically (the sound is really irritating).
If you want to remove the sound use this bookmarklet which deletes the iframe used to load the Flash file:

javascript:(function(){var rancidbacon={};try{rancidbacon.com=document.getElementsByName("pm-sound")[0];rancidbacon.com.parentElement.removeChild(rancidbacon.com);}catch(_){}})()

More details here: http://stuff.rancidbacon.com/google-pacman/

NoScript blocked the googleusercontent.com by default, so I didn't even realize there was sound until reading this discussion.
I agree with that. By accident the volume on this machine was still way up from watching a movie, and it must have woken up the whole damn building.
This is great, except for that some element of Google (address bar search?) is running in the background of my firefox browser and the siren audio is on a continuous loop even after leaving Google. No add-on or plug-in I remove helps.
This even works on the abomination that is IE6.

That's what they get from not using Canvas or any other technology newer than 10 years old. The game is built of 8x8 pixel DIVs.

Maybe it was originally written for the 20th anniversary.
I hope I'm not the only one offended that the ghosts don't act like their pacman counterparts. Red is such a puss in google land!
I'd love to see the analytics on their home page for today.
Average time on site: 3 hours.

(no, not really)