summaryrefslogtreecommitdiff
path: root/game-debug.html.coffee
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2014-09-28 13:48:04 (GMT)
committerMichele Bini <michele.bini@gmail.com>2014-09-28 13:48:04 (GMT)
commit5e6096cecc2756b4a23d211c061f805da385c89f (patch)
tree1c52b04af7958f57e8188d74ae909cff4256abe8 /game-debug.html.coffee
parentb16d4739bbe00b9ce9f8c488ce7ea8b31e9468a5 (diff)
Quick bugfix for some browsers that don't support automatic update of SVG objects from properties
Diffstat (limited to 'game-debug.html.coffee')
-rw-r--r--game-debug.html.coffee18
1 files changed, 10 insertions, 8 deletions
diff --git a/game-debug.html.coffee b/game-debug.html.coffee
index 882e284..e9645f5 100644
--- a/game-debug.html.coffee
+++ b/game-debug.html.coffee
@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-version = "0.0.2"
+version = "0.0.10"
{ htmlcup } = require 'htmlcup'
@@ -219,8 +219,10 @@ genPage = ->
@scaleX = 1
else if vx < 0
@scaleX = -1
- # @e.setAttribute "transform", "translate(#{x}, #{y}) scale(#{@scaleX}, 1)"
+ @e.setAttribute "transform", "translate(#{x}, #{y}) scale(#{@scaleX}, 1)"
m = @m; m.e = x; m.f = y; m.a = @scaleX
+ # @e.transform.baseVal.consolidate()
+ # @e.transform.baseVal.initialize(@e.transform.baseVal.matrix)
sea = document.getElementById "sea"
v = sea.firstChild
@@ -240,7 +242,7 @@ genPage = ->
sea.appendChild n
angle = Math.random() * 6.28
vaquita =
- # e: n
+ e: n
m: getTransformMatrix(n)
x: Math.sin(angle) * 300
y: Math.cos(angle) * 300
@@ -292,17 +294,17 @@ genPage = ->
if (time & 0xff) is 0x00 and vaquitas.length < 4
addVaquita()
# s += 0.001
- x -= vx = 1 # pressedKeys[leftKey] - pressedKeys[rightKey]
+ x -= vx = pressedKeys[leftKey] - pressedKeys[rightKey]
y -= pressedKeys[upKey] - pressedKeys[downKey]
if vx > 0
scaleX = 1
else if vx < 0
scaleX = -1
- # v.setAttribute("transform", "translate(#{x}, #{y}) scale(#{scaleX}, #{scaleY})")
+ v.setAttribute("transform", "translate(#{x}, #{y}) scale(#{scaleX}, #{scaleY})")
# transform = v.transform.baseVal.getItem(0)
- transformMatrix.a = scaleX
- transformMatrix.e = x
- transformMatrix.f = y
+ # transformMatrix.a = scaleX
+ # transformMatrix.e = x
+ # transformMatrix.f = y
if (time % 3) is 0
if currentFrame.baseVal is "#twistleft"
currentFrame .baseVal = "#_"