diff options
| author | manuel <manuel@mausz.at> | 2011-04-13 02:23:04 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-13 02:23:04 +0200 |
| commit | 5305fd513b105245059f55d82fc6210ad99d1d14 (patch) | |
| tree | c6ce5eba96d0bd8eea669812d6475380958f0bfd /pacman-google/src/js/pacman10-hp.3.js | |
| parent | 876e2019f150dbb714f5795f6f2bd2bc17811c6c (diff) | |
| download | foop-5305fd513b105245059f55d82fc6210ad99d1d14.tar.gz foop-5305fd513b105245059f55d82fc6210ad99d1d14.tar.bz2 foop-5305fd513b105245059f55d82fc6210ad99d1d14.zip | |
google sounds again
Diffstat (limited to 'pacman-google/src/js/pacman10-hp.3.js')
| -rw-r--r-- | pacman-google/src/js/pacman10-hp.3.js | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/pacman-google/src/js/pacman10-hp.3.js b/pacman-google/src/js/pacman10-hp.3.js index 604c64d..93fa5a9 100644 --- a/pacman-google/src/js/pacman10-hp.3.js +++ b/pacman-google/src/js/pacman10-hp.3.js | |||
| @@ -1803,12 +1803,10 @@ function () { | |||
| 1803 | return [c, b] | 1803 | return [c, b] |
| 1804 | }; | 1804 | }; |
| 1805 | E.prototype.b = function () { | 1805 | E.prototype.b = function () { |
| 1806 | // this calculates the sprite position | ||
| 1807 | this.k(); | 1806 | this.k(); |
| 1808 | var b = [0, 0]; | 1807 | var b = [0, 0]; |
| 1809 | b = g.gameplayMode == 8 || g.gameplayMode == 14 ? [0, 3] : this.ghost ? this.r() : this.s(); | 1808 | b = g.gameplayMode == 8 || g.gameplayMode == 14 ? [0, 3] : this.ghost ? this.r() : this.s(); |
| 1810 | if (this.elBackgroundPos[0] != b[0] || this.elBackgroundPos[1] != b[1]) { | 1809 | if (this.elBackgroundPos[0] != b[0] || this.elBackgroundPos[1] != b[1]) { |
| 1811 | console.log("changeElementBkPos: b=" + b) | ||
| 1812 | this.elBackgroundPos[0] = b[0]; | 1810 | this.elBackgroundPos[0] = b[0]; |
| 1813 | this.elBackgroundPos[1] = b[1]; | 1811 | this.elBackgroundPos[1] = b[1]; |
| 1814 | b[0] *= 16; | 1812 | b[0] *= 16; |
| @@ -1859,7 +1857,6 @@ function () { | |||
| 1859 | b.style.backgroundImage = "url(src/pacman10-hp-sprite-2.png)"; | 1857 | b.style.backgroundImage = "url(src/pacman10-hp-sprite-2.png)"; |
| 1860 | b.style.backgroundPosition = -c + "px " + -d + "px"; | 1858 | b.style.backgroundPosition = -c + "px " + -d + "px"; |
| 1861 | b.style.backgroundRepeat = "no-repeat" | 1859 | b.style.backgroundRepeat = "no-repeat" |
| 1862 | console.log("prepareElement: id=" + b.id + ", bgpos=", b.style.backgroundPosition) | ||
| 1863 | } else { | 1860 | } else { |
| 1864 | b.style.overflow = "hidden"; | 1861 | b.style.overflow = "hidden"; |
| 1865 | c = "display: block; position: relative; left: " + -c + "px; top: " + -d + "px"; | 1862 | c = "display: block; position: relative; left: " + -c + "px; top: " + -d + "px"; |
| @@ -1868,15 +1865,10 @@ function () { | |||
| 1868 | }; | 1865 | }; |
| 1869 | g.changeElementBkPos = function (b, c, d, f) { | 1866 | g.changeElementBkPos = function (b, c, d, f) { |
| 1870 | if (f) { | 1867 | if (f) { |
| 1871 | console.log("changeElementBkPos: c=" + c + ", d=" + d) | ||
| 1872 | c = g.getCorrectedSpritePos(c); | 1868 | c = g.getCorrectedSpritePos(c); |
| 1873 | d = g.getCorrectedSpritePos(d) | 1869 | d = g.getCorrectedSpritePos(d) |
| 1874 | console.log("changeElementBkPos: c=" + c + ", d=" + d) | ||
| 1875 | } | ||
| 1876 | if (g.useCss) { | ||
| 1877 | b.style.backgroundPosition = -c + "px " + -d + "px"; | ||
| 1878 | console.log("changeElementBkPos: id=" + b.id + ", bgpos=", b.style.backgroundPosition) | ||
| 1879 | } | 1870 | } |
| 1871 | if (g.useCss) b.style.backgroundPosition = -c + "px " + -d + "px"; | ||
| 1880 | else if (b.childNodes[0]) { | 1872 | else if (b.childNodes[0]) { |
| 1881 | b.childNodes[0].style.left = -c + "px"; | 1873 | b.childNodes[0].style.left = -c + "px"; |
| 1882 | b.childNodes[0].style.top = -d + "px" | 1874 | b.childNodes[0].style.top = -d + "px" |
| @@ -2374,12 +2366,7 @@ function () { | |||
| 2374 | for (var b = g.playerCount; b < g.playerCount + 4; b++) g.actors[b].B() | 2366 | for (var b = g.playerCount; b < g.playerCount + 4; b++) g.actors[b].B() |
| 2375 | }; | 2367 | }; |
| 2376 | g.moveActors = function () { | 2368 | g.moveActors = function () { |
| 2377 | for (var b in g.actors) | 2369 | for (var b in g.actors) g.actors[b].move() |
| 2378 | { | ||
| 2379 | if (g.actors[b].ghost) | ||
| 2380 | continue; | ||
| 2381 | g.actors[b].move() | ||
| 2382 | } | ||
| 2383 | }; | 2370 | }; |
| 2384 | g.ghostDies = function (b, c) { | 2371 | g.ghostDies = function (b, c) { |
| 2385 | g.playSound("eating-ghost", 0); | 2372 | g.playSound("eating-ghost", 0); |
| @@ -2910,6 +2897,7 @@ function () { | |||
| 2910 | g.playSound = function (b, c, d) { | 2897 | g.playSound = function (b, c, d) { |
| 2911 | if (!(!g.soundAvailable || !google.pacManSound || g.paused)) { | 2898 | if (!(!g.soundAvailable || !google.pacManSound || g.paused)) { |
| 2912 | d || g.stopSoundChannel(c); | 2899 | d || g.stopSoundChannel(c); |
| 2900 | console.log("play: " + b); | ||
| 2913 | try { | 2901 | try { |
| 2914 | g.flashSoundPlayer.playTrack(b, c) | 2902 | g.flashSoundPlayer.playTrack(b, c) |
| 2915 | } catch (f) { | 2903 | } catch (f) { |
| @@ -2968,6 +2956,7 @@ function () { | |||
| 2968 | var b = 0; | 2956 | var b = 0; |
| 2969 | if (g.gameplayMode == 0 || g.gameplayMode == 1) b = g.ghostEyesCount ? "ambient-eyes" : g.mainGhostMode == 4 ? "ambient-fright" : g.dotsEaten > 241 ? "ambient-4" : g.dotsEaten > 207 ? "ambient-3" : g.dotsEaten > 138 ? "ambient-2" : "ambient-1"; | 2957 | if (g.gameplayMode == 0 || g.gameplayMode == 1) b = g.ghostEyesCount ? "ambient-eyes" : g.mainGhostMode == 4 ? "ambient-fright" : g.dotsEaten > 241 ? "ambient-4" : g.dotsEaten > 207 ? "ambient-3" : g.dotsEaten > 138 ? "ambient-2" : "ambient-1"; |
| 2970 | else if (g.gameplayMode == 13) b = "cutscene"; | 2958 | else if (g.gameplayMode == 13) b = "cutscene"; |
| 2959 | console.log("play ambient: " + b); | ||
| 2971 | if (b) try { | 2960 | if (b) try { |
| 2972 | g.flashSoundPlayer.playAmbientTrack(b) | 2961 | g.flashSoundPlayer.playAmbientTrack(b) |
| 2973 | } catch (c) { | 2962 | } catch (c) { |
