From 9f083a57cec4613b4fdc73700251a4cc724be369 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 13 Apr 2017 12:55:33 +0000 Subject: [PATCH] cleaner animation stepping svn path=/trunk/; revision=7 --- character_3.svg | 252 ++++++++++++++++++++++++------------------------ index.html | 10 +- 2 files changed, 135 insertions(+), 127 deletions(-) diff --git a/character_3.svg b/character_3.svg index 053299e..624b2b4 100644 --- a/character_3.svg +++ b/character_3.svg @@ -158,8 +158,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="3.7" - inkscape:cx="109.68858" - inkscape:cy="215.44594" + inkscape:cx="26.776154" + inkscape:cy="136.54215" inkscape:document-units="px" inkscape:current-layer="g6611" showgrid="true" @@ -217,7 +217,7 @@ image/svg+xml - + @@ -1041,61 +1041,61 @@ style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="ellipse7099" cx="-146.53148" - cy="895.04193" + cy="894.65173" rx="1.1830357" - ry="3.9062765" + ry="3.7462771" inkscape:transform-center-x="-0.04464269" - inkscape:transform-center-y="8.4735159" /> + inkscape:transform-center-y="8.1264634" /> + inkscape:transform-center-y="2.3488755" /> + inkscape:transform-center-y="2.8441696" /> + inkscape:transform-center-y="9.9223556" /> + inkscape:transform-center-y="12.896758" /> + inkscape:transform-center-y="14.819267" /> + style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.10000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + ry="3.9001367" /> + ry="3.497021" /> + style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.10000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.10000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + ry="0.50259501" /> + ry="3.8629601" /> + ry="3.4636869" /> + ry="0.49780416" /> + inkscape:transform-center-y="7.869092" /> + inkscape:transform-center-y="2.2744874" /> + inkscape:transform-center-y="12.488231" /> + style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.10000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + ry="3.8798881" /> + ry="3.4788649" /> + style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.10000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#ffeebb;fill-opacity:1;stroke:#000000;stroke-width:0.10000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + ry="0.49998558" /> + inkscape:transform-center-y="2.359535" /> + inkscape:transform-center-y="8.2316053" /> + inkscape:transform-center-y="12.293983" /> + inkscape:transform-center-y="8.0238573" /> + inkscape:transform-center-y="2.3192064" /> + inkscape:transform-center-y="2.8402409" /> + inkscape:transform-center-y="9.9087833" /> + inkscape:transform-center-y="12.733992" /> + inkscape:transform-center-y="14.798859" /> @@ -4628,20 +4628,20 @@ rx="1.3801233" ry="3.7726445" /> diff --git a/index.html b/index.html index 0debcfa..76bd4b2 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Canvas not supported
- +
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, @@ -175,6 +175,14 @@ player = { case 'sw': dy = .45 * this.speed; dx = -.9 * this.speed; break; case 'se': dy = .45 * this.speed; dx = .9 * this.speed; break; } + + if (player.frame % 6 > 2) { + dx *= 1.375; + dy *= 1.375 + } else { + dx *= .625; + dy *= .625; + } if (map.data[map.tile_at(this.x + dx, this.y + dy)] != 4) { this.x += dx; this.y += dy; -- 2.39.2