From 818383fec4f220a2410177b58518797e81d8eab3 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 3 Apr 2011 16:28:52 +0200 Subject: basic pacman qt setup --- pacman-google/src/js/pacman10-hp.3.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'pacman-google') 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 () { return [c, b] }; E.prototype.b = function () { + // this calculates the sprite position this.k(); var b = [0, 0]; b = g.gameplayMode == 8 || g.gameplayMode == 14 ? [0, 3] : this.ghost ? this.r() : this.s(); if (this.elBackgroundPos[0] != b[0] || this.elBackgroundPos[1] != b[1]) { + console.log("changeElementBkPos: b=" + b) this.elBackgroundPos[0] = b[0]; this.elBackgroundPos[1] = b[1]; b[0] *= 16; @@ -1857,6 +1859,7 @@ function () { b.style.backgroundImage = "url(src/pacman10-hp-sprite-2.png)"; b.style.backgroundPosition = -c + "px " + -d + "px"; b.style.backgroundRepeat = "no-repeat" + console.log("prepareElement: id=" + b.id + ", bgpos=", b.style.backgroundPosition) } else { b.style.overflow = "hidden"; c = "display: block; position: relative; left: " + -c + "px; top: " + -d + "px"; @@ -1865,10 +1868,15 @@ function () { }; g.changeElementBkPos = function (b, c, d, f) { if (f) { + console.log("changeElementBkPos: c=" + c + ", d=" + d) c = g.getCorrectedSpritePos(c); d = g.getCorrectedSpritePos(d) + console.log("changeElementBkPos: c=" + c + ", d=" + d) + } + if (g.useCss) { + b.style.backgroundPosition = -c + "px " + -d + "px"; + console.log("changeElementBkPos: id=" + b.id + ", bgpos=", b.style.backgroundPosition) } - if (g.useCss) b.style.backgroundPosition = -c + "px " + -d + "px"; else if (b.childNodes[0]) { b.childNodes[0].style.left = -c + "px"; b.childNodes[0].style.top = -d + "px" @@ -2366,7 +2374,12 @@ function () { for (var b = g.playerCount; b < g.playerCount + 4; b++) g.actors[b].B() }; g.moveActors = function () { - for (var b in g.actors) g.actors[b].move() + for (var b in g.actors) + { + if (g.actors[b].ghost) + continue; + g.actors[b].move() + } }; g.ghostDies = function (b, c) { g.playSound("eating-ghost", 0); @@ -3197,4 +3210,4 @@ function () { g.prepareSound() }; g.init(); -}(); \ No newline at end of file +}(); -- cgit v1.2.3