summaryrefslogtreecommitdiff
path: root/game.html.coffee
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2014-09-28 11:04:25 (GMT)
committerMichele Bini <michele.bini@gmail.com>2014-09-28 11:04:25 (GMT)
commit7c57f7211a62aab04e7629bd3eb472589c39c699 (patch)
tree694880d8b64fd73bdeb5066da742dabd52ede050 /game.html.coffee
parent4d0d08112f023a5779178399bb589988c2bcb939 (diff)
Add a simple twisting-swimming animation, without intermediate frames
Diffstat (limited to 'game.html.coffee')
-rw-r--r--game.html.coffee12
1 files changed, 12 insertions, 0 deletions
diff --git a/game.html.coffee b/game.html.coffee
index 548d797..f80c3ca 100644
--- a/game.html.coffee
+++ b/game.html.coffee
@@ -26,8 +26,10 @@ datauriicon = (x)-> datauri "image/x-icon", x
icon = datauriicon "vaquita.ico"
pixyvaquita = datauripng "pixyvaquita_v2.png"
+pixyvaquita_v105 = datauripng "pixyvaquita_v2.png"
frames =
_: pixyvaquita
+ _v105: pixyvaquita
twistleft: datauripng "pixyvaquita_v2_twistleft.png"
useSvg = true
@@ -257,12 +259,17 @@ genPage = ->
do (x = 0, y = 0)->
time = 0
+ vx = 0
+ vy = 0
+ ax = 0
+ ay = 0
# s = 1
# x = 0
# y = 0
scaleX = 1
scaleY = 1
+ window.cf = currentFrame = v.href
transformMatrix = getTransformMatrix(v)
transformMatrix.a = scaleX
transformMatrix.e = x
@@ -283,6 +290,11 @@ genPage = ->
transformMatrix.a = scaleX
transformMatrix.e = x
transformMatrix.f = y
+ if (time % 3) is 0
+ if currentFrame.baseVal is "#twistleft"
+ currentFrame .baseVal = "#_"
+ else if vx isnt 0
+ currentFrame.baseVal = "#twistleft"
# transformList.initialize(transform)
vq.update() for vq in vaquitas
time++