diff options
Diffstat (limited to 'pacman-google')
| -rw-r--r-- | pacman-google/src/js/pacman10-hp.3.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/pacman-google/src/js/pacman10-hp.3.js b/pacman-google/src/js/pacman10-hp.3.js index fe3ef91..604c64d 100644 --- a/pacman-google/src/js/pacman10-hp.3.js +++ b/pacman-google/src/js/pacman10-hp.3.js | |||
| @@ -1803,10 +1803,12 @@ 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 | ||
| 1806 | this.k(); | 1807 | this.k(); |
| 1807 | var b = [0, 0]; | 1808 | var b = [0, 0]; |
| 1808 | b = g.gameplayMode == 8 || g.gameplayMode == 14 ? [0, 3] : this.ghost ? this.r() : this.s(); | 1809 | b = g.gameplayMode == 8 || g.gameplayMode == 14 ? [0, 3] : this.ghost ? this.r() : this.s(); |
| 1809 | if (this.elBackgroundPos[0] != b[0] || this.elBackgroundPos[1] != b[1]) { | 1810 | if (this.elBackgroundPos[0] != b[0] || this.elBackgroundPos[1] != b[1]) { |
| 1811 | console.log("changeElementBkPos: b=" + b) | ||
| 1810 | this.elBackgroundPos[0] = b[0]; | 1812 | this.elBackgroundPos[0] = b[0]; |
| 1811 | this.elBackgroundPos[1] = b[1]; | 1813 | this.elBackgroundPos[1] = b[1]; |
| 1812 | b[0] *= 16; | 1814 | b[0] *= 16; |
| @@ -1857,6 +1859,7 @@ function () { | |||
| 1857 | b.style.backgroundImage = "url(src/pacman10-hp-sprite-2.png)"; | 1859 | b.style.backgroundImage = "url(src/pacman10-hp-sprite-2.png)"; |
| 1858 | b.style.backgroundPosition = -c + "px " + -d + "px"; | 1860 | b.style.backgroundPosition = -c + "px " + -d + "px"; |
| 1859 | b.style.backgroundRepeat = "no-repeat" | 1861 | b.style.backgroundRepeat = "no-repeat" |
| 1862 | console.log("prepareElement: id=" + b.id + ", bgpos=", b.style.backgroundPosition) | ||
| 1860 | } else { | 1863 | } else { |
| 1861 | b.style.overflow = "hidden"; | 1864 | b.style.overflow = "hidden"; |
| 1862 | c = "display: block; position: relative; left: " + -c + "px; top: " + -d + "px"; | 1865 | c = "display: block; position: relative; left: " + -c + "px; top: " + -d + "px"; |
| @@ -1865,10 +1868,15 @@ function () { | |||
| 1865 | }; | 1868 | }; |
| 1866 | g.changeElementBkPos = function (b, c, d, f) { | 1869 | g.changeElementBkPos = function (b, c, d, f) { |
| 1867 | if (f) { | 1870 | if (f) { |
| 1871 | console.log("changeElementBkPos: c=" + c + ", d=" + d) | ||
| 1868 | c = g.getCorrectedSpritePos(c); | 1872 | c = g.getCorrectedSpritePos(c); |
| 1869 | d = g.getCorrectedSpritePos(d) | 1873 | 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) | ||
| 1870 | } | 1879 | } |
| 1871 | if (g.useCss) b.style.backgroundPosition = -c + "px " + -d + "px"; | ||
| 1872 | else if (b.childNodes[0]) { | 1880 | else if (b.childNodes[0]) { |
| 1873 | b.childNodes[0].style.left = -c + "px"; | 1881 | b.childNodes[0].style.left = -c + "px"; |
| 1874 | b.childNodes[0].style.top = -d + "px" | 1882 | b.childNodes[0].style.top = -d + "px" |
| @@ -2366,7 +2374,12 @@ function () { | |||
| 2366 | for (var b = g.playerCount; b < g.playerCount + 4; b++) g.actors[b].B() | 2374 | for (var b = g.playerCount; b < g.playerCount + 4; b++) g.actors[b].B() |
| 2367 | }; | 2375 | }; |
| 2368 | g.moveActors = function () { | 2376 | g.moveActors = function () { |
| 2369 | for (var b in g.actors) g.actors[b].move() | 2377 | for (var b in g.actors) |
| 2378 | { | ||
| 2379 | if (g.actors[b].ghost) | ||
| 2380 | continue; | ||
| 2381 | g.actors[b].move() | ||
| 2382 | } | ||
| 2370 | }; | 2383 | }; |
| 2371 | g.ghostDies = function (b, c) { | 2384 | g.ghostDies = function (b, c) { |
| 2372 | g.playSound("eating-ghost", 0); | 2385 | g.playSound("eating-ghost", 0); |
| @@ -3197,4 +3210,4 @@ function () { | |||
| 3197 | g.prepareSound() | 3210 | g.prepareSound() |
| 3198 | }; | 3211 | }; |
| 3199 | g.init(); | 3212 | g.init(); |
| 3200 | }(); \ No newline at end of file | 3213 | }(); |
