Permalink
Browse files

fix sound in offline mode

  • Loading branch information...
1 parent dcf0803 commit 049b443c9448e4e35141cf0021e7387850899991 @macek committed May 23, 2010
Showing with 69 additions and 250 deletions.
  1. +11 −60 README
  2. +58 −190 index.html
View
71 README
@@ -5,7 +5,7 @@ This is a copy of Google's playable Pacman game logo hosted for
Pacman's 30th Anniversary.
With the help of StackOverflow users, we were able to get a playable
-version working.
+version working 100%.
To play a live version: http://macek.github.com/google_pacman/
@@ -15,71 +15,22 @@ Or download the source and run it offline.
-Confusion Surrounding Audio Bug
--------------------------------
-When this repository was originally created, Google was using:
-
- logos/js/pacman10-hp.2.js
- logos/pacman10-hp-sprite.png
-
-They have since updated to:
-
- logos/js/pacman10-hp.3.js
- logos/pacman10-hp-sprite-2.png
-
-As you can see, the new sprite features a mute button. Those playing on
-a webserver should have a fully functioning game now. However, music
-and sound do not work when playing locally.
-
-
-
-@winwakr found this fix for the time being:
-
-A snippet from Adobe.com
-
- For example, a trusted local HTML file may permit an untrusted local
- SWF to script it by setting allowScriptAccess="always". However, an
- untrusted local HTML file may never permit an untrusted local SWF to
- script it, regardless of the value of allowScriptAccess.
-
-To have flash trust your local SWF, you must add your `google_pacman`
-folder to the allow list using your Flash Control Panel.
-
- 1. Adobe Flash Control Panel:
- http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html
-
- 2. Click `Edit Locations`
-
- 3. Click `Add Location`
-
- 4. Browse to your `google_pacman` directory
-
- 5. Click `Add`
-
-Read more about this issue here:
-http://www.adobe.com/devnet/flash/articles/fplayer8_security_09.html
-
-
-
-
-
-Wishlist
---------
-1. Get sound working (when playing locally)
-2. Strip out unnecessary Google code
-
-
-
-
-
Thanks to:
----------
SteD for providing a nicely formatted version of pacman10-hp.2.js
Skizo for noticing that relative paths don't work as expected when
-executed locally.
+executed locally
Mason Barry for cleaning up the homepage, adding a nice starting graphic,
and fixing the `Insert Coin` button
-KevinCathcart for recommending we setup a live version on the `gh-pages` branch.
+winwakr for showing us how to get sound working in offline mode.
+
+KevinCathcart for recommending we setup a live version on the `gh-pages` branch
+
+KevinCathcart for removing a good amount of unnecessary HTML/JavaScript
+
+KevinCathcart and Barry Silverman for getting the famous intro song working
+
+Barry Silverman for getting sound working in offline mode
View
@@ -2,157 +2,59 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Google</title>
+ <title>Google Pacman</title>
<script>
- window.google = {
- kEI: "zNr2S6z3C4f0eNui1bYK",
- kEXPI: "17259,18168,24661,24737,24745",
- kCSI: {
- e: "17259,18168,24661,24737,24745",
- ei: "zNr2S6z3C4f0eNui1bYK",
- expi: "17259,18168,24661,24737,24745"
- },
- ml: function () {},
- kHL: "en",
- time: function () {
- return (new Date).getTime()
- },
- log: function (b, d, c) {
- var a = new Image,
- e = google,
- g = e.lc,
- f = e.li;
- a.onerror = (a.onload = (a.onabort = function () {
- delete g[f]
- }));
- g[f] = a;
- c = c || "/gen_204?atyp=i&ct=" + b + "&cad=" + d + "&zx=" + google.time();
- a.src = c;
- e.li = f + 1
- },
- lc: [],
- li: 0,
- Toolbelt: {}
- };
- window.google.sn = "webhp";
- window.google.timers = {
- load: {
- t: {
- start: (new Date).getTime()
- }
- }
- };
+ window.google = {}
</script>
<style>
- body{margin:0}
- #gog{padding:3px 8px 0}
+ body{background:#222;font-family:monospace;margin-top:50px}
td{line-height:.8em;}
- .gac_m td{line-height:17px;}
form{margin-bottom:20px;}
- body,td,a,p,.h{font-family:arial,sans-serif}
- .h{color:#36c;font-size:20px}
- .q{color:#00c}
- .ts td{padding:0}
- .ts{border-collapse:collapse}
- em{font-weight:bold;font-style:normal}
- .lst{width:496px}
- input{font-family:inherit}
- .lsb:active,.gac_sb:active{background:-webkit-gradient(linear,left top,left bottom,from(#ccc),to(#ddd))}
- #fctr,#ghead,#pmocntr,#sbl,#tba,#tbe,.fade{opacity:0;}
- #fctr,#ghead,#pmocntr,#sbl,#tba,#tbe,.fade{background:#fff;}
- a.gb1,a.gb2,a.gb3,a.gb4{color:#11c !important}
- #gog{background:#fff;}
- #gbar,#guser{font-size:13px;padding-top:1px !important}
- #gbar{float:left;height:22px}
- #guser{padding-bottom:7px !important;text-align:right}
- .gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}
- .gbh{height:0;position:absolute;top:24px;width:100%}
- #gbs,.gbm{background:#fff;left:0;position:absolute;text-align:left;visibility:hidden;z-index:1000}
- .gbm{border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;z-index:1001}
- .gb1{margin-right:.5em}
- .gb1,.gb3{zoom:1}
- .gb2{display:block;padding:.2em .5em;}
- .gb2,.gb3{text-decoration:none;border-bottom:none}
- a.gb1,a.gb2,a.gb3,a.gb4{color:#00c !important}
- a.gb2:hover{background:#36c;color:#fff !important}
- body{background:#000;color:black;}
- input{-moz-box-sizing:content-box}
+ input{font-family:inherit;-moz-box-sizing:content-box}
a{color:#11c;text-decoration:none}
a:hover,a:active{text-decoration:underline}
- .fl a{color:#4272db}
a:visited{color:#551a8b}
- a.gb1,a.gb4{text-decoration:underline}
- a.gb3:hover{text-decoration:none}
- #ghead a.gb2:hover{color:#fff!important}
+ #logo{width:554px;height:186px;background:black url(logos/pacman10-hp.gif) 0 0 no-repeat;position:relative;margin-bottom:9px}
+ #logo-l{width:200px;height:2px;left:177px;top:157px;background:#990;position:absolute;display:none;overflow:hidden}
+ #logo-b{position:absolute;left:0;background:#ff0;height:8px;width:0}
+ #wrapper{width:554px;height:186px;padding:10px;background:#000;-webkit-border-radius:8px;}
+ .lsb:active{background:-webkit-gradient(linear,left top,left bottom,from(#ccc),to(#ddd))}
.ds{display:-moz-inline-box}
.ds{border-bottom:solid 1px #e7e7e7;border-right:solid 1px #e7e7e7;display:inline-block;margin:3px 0 4px;margin-left:4px;margin-right:3px:height:32px}
- .sblc{padding-top:5px}
- .sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px;}
.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px;display:block}
.lsb{background:url(/images/srpr/nav_logo13.png) bottom;font:15px arial,sans-serif;border:none;cursor:pointer;height:30px;margin:0;outline:0;vertical-align:top}
.lsb:active{background:#ccc}
- .lst:focus{outline:none}
- .ftl,#fll a{margin:0 12px}
- #addlang a{padding:0 3px}
- .gac_v div{display:none}
- .gac_v .gac_v2,.gac_bt{display:block!important}
- #github{color:#333;font-size:10pt;font-family:monospace;padding:5px;}
- #github:hover{color:#555;text-decoration:none;background:#222;}
+ #github{display:inline-block;color:#444;font-size:10pt;font-family:monospace;padding:5px;}
+ #github:hover{color:#666;text-decoration:none;background:#333;}
</style>
- <noscript>
- <style>
- #fctr,#ghead,#pmocntr,#sbl,#tba,#tbe,.fade{opacity:1;}
- </style>
- </noscript>
- <script>
- google.y = {};
- google.x = function (e, g) {
- google.y[e.id] = [e, g];
- return false
- };
- if (!window.google) window.google = {};
- window.google.crm = {};
- window.google.cri = 0;
- window.clk = function (e, f, g, k, l, b, m) {
- if (document.images) {
- var a = encodeURIComponent || escape,
- c = new Image,
- h = window.google.cri++;
- window.google.crm[h] = c;
- c.onerror = (c.onload = (c.onabort = function () {
- delete window.google.crm[h]
- }));
- if (b && b.substring(0, 6) != "&sig2=") b = "&sig2=" + b;
- c.src = ["/url?sa=T", "", f ? "&oi=" + a(f) : "", g ? "&cad=" + a(g) : "", "&ct=", a(k || "res"), "&cd=", a(l), "&ved=", a(m), e ? "&url=" + a(e.replace(/#.*/, "")).replace(/\+/g, "%2B") : "", "&ei=", "zNr2S6z3C4f0eNui1bYK", b].join("")
- }
- return true
- };
- window.gbar = {
- qs: function () {},
- tg: function (e) {
- var o = {
- id: 'gbar'
- };
- for (i in e) o[i] = e[i];
- google.x(o, function () {
- gbar.tg(o)
- })
- }
- };
- </script>
</head>
-<body text='#000000' link='#0000cc' vlink='#551a8b' alink='#ff0000'>
-<center><br clear='all' id='lgpd'>
-<div id='lga'>
- <a href="#gameover" id="dlink"></a>
- <div id='logo' style="width:554px;height:186px;background:black url(logos/pacman10-hp.gif) 0 0 no-repeat;position:relative;margin-bottom:9px" title="PAC-MAN's 30th Birthday! Doodle with PAC-MAN™ & ©1980 NAMCO BANDAI Games Inc.">
- <div id="logo-l" style="width:200px;height:2px;left:177px;top:157px;background:#990;position:absolute;display:none;overflow:hidden">
- <div id="logo-b" style="position:absolute;left:0;background:#ff0;height:8px;width:0">
- </div>
- </div>
+<body>
+ <center>
+ <div id="wrapper">
+ <a href="#gameover" id="dlink"></a>
+ <div id='logo' title="PAC-MAN's 30th Birthday! Doodle with PAC-MAN™ & ©1980 NAMCO BANDAI Games Inc.">
+ <div id="logo-l">
+ <div id="logo-b">
+ </div>
+ </div>
+ </div>
</div>
<script>
- google.pml = function () {
+ google.dom = {};
+ google.pacManSound = true;
+ google.browser = {};
+ google.browser.engine = {}
+
+ google.dom.remove = function (a) {
+ return a && a.parentNode && a.parentNode.removeChild(a)
+ };
+
+ google.dom.append = function (a) {
+ return document.body.appendChild(a)
+ };
+
+ google.browser.engine.IE = false
+ google.pml = function () {
function d(a) {
if (!google.pml_installed) {
google.pml_installed = true;
@@ -166,75 +68,41 @@
a = document.createElement("script");
a.type = "text/javascript";
a.src = "logos/js/pacman10-hp.3.js";
- google.dom.append(a)
+ document.body.appendChild(a)
}
}
function e() {
if (document.f && document.f.btnI) document.f.btnI.onclick = function () {
- if (typeof google.pacman != "undefined") google.pacman.insertCoin()
- else {
- google.pacManSound = true;
- d(false);
- }
- return false
+ typeof google.pacman != "undefined" ? google.pacman.insertCoin() : d(false);
+ return false
}
}
if (!google.pml_loaded) {
google.pml_loaded = true;
- /*
window.setTimeout(function () {
- d(true)
+ document.f && d(true)
}, 1E4);
- */
e();
- google.rein && google.rein.push(e);
- google.dstr && google.dstr.push(function () {
- google.pacman && google.pacman.destroy();
- if (google.pml_installed) {
- for (var a = (document.getElementById("xjsc") || document.body).getElementsByTagName("script"), b = 0, c; c = a[b++];) c.src.indexOf("logos/js") != -1 && google.dom.remove(c);
- google.pml_installed = false
- }
- });
- google.pacManQuery = function () {
- google.nav(document.getElementById("dlink").href)
- }
}
};
</script>
-</div>
-<form action="#submit" name='f'>
- <table width="23%" cellpadding='0' cellspacing='0'>
- <tr valign='top'>
- <td align='center' nowrap><br style="line-height:0">
- <span class='ds'>
- <span class='lsbb'>
- <input name='btnI' type='submit' value="Insert Coin" class='lsb'>
+
+ <form action="#submit" name='f'>
+ <table width="23%" cellpadding='0' cellspacing='0'>
+ <tr valign='top'>
+ <td align='center' nowrap><br style="line-height:0">
+ <span class='ds'>
+ <span class='lsbb'>
+ <input name='btnI' type='submit' value="Insert Coin" class='lsb'>
+ </span>
</span>
- </span>
- </td>
- </tr>
- </table>
-</form>
-<center>
+ </td>
+ </tr>
+ </table>
+ </form>
+
<a id="github" href="http://github.com/macek/google_pacman">GitHub macek/google_pacman</a>
-</center>
-<span id='footer'><center id='fctr'></center></span>
-<div id='xjsd'>
-</div>
-<div id='xjsi'>
- <script>
- if (google.y) google.y.first = [];
- google.dstr = [];
- google.rein = [];
- window.setTimeout(function () {
- var a = document.createElement("script");
- // Google src originally links to /extern_js/f/SOME_LONG_HASH/ANOTHER_HASH.js
- // It is regenerated upon each page refresh
- a.src = "extern_js/google.js";
- (document.getElementById("xjsd") || document.body).appendChild(a);
- if (google.timers && google.timers.load.t) google.timers.load.t.xjsls = (new Date).getTime();
- }, 0);;
- google.neegg = 1;
- google.pml && google.pml();
- </script>
-</div>
+
+ <script>google.pml && google.pml()</script>
+ </center>
+</html>

0 comments on commit 049b443

Please sign in to comment.