Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Integrate some animations

  • Loading branch information...
commit 70bef5eaa8f071b57d0952e61ab3d6326adb8618 1 parent f54b32b
@asivitz authored
View
2  ext/Platform.cpp
@@ -107,7 +107,7 @@ void Platform::draw()
glBindFramebuffer(GL_FRAMEBUFFER,0);
- bool draw_debug = true;
+ bool draw_debug = false;
glViewport(0, 0, 600, 600);
renderer->draw();
View
296 images/red_anims.json
@@ -2,7 +2,7 @@
"red-idle0001.png":
{
- "frame": {"x":174,"y":82,"w":38,"h":56},
+ "frame": {"x":162,"y":42,"w":38,"h":56},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":56},
@@ -10,15 +10,15 @@
},
"red-idle0002.png":
{
- "frame": {"x":408,"y":42,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":82,"y":450,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":4,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-idle0003.png":
{
- "frame": {"x":230,"y":160,"w":38,"h":54},
+ "frame": {"x":386,"y":158,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":6,"w":38,"h":54},
@@ -26,7 +26,7 @@
},
"red-idle0004.png":
{
- "frame": {"x":58,"y":302,"w":38,"h":52},
+ "frame": {"x":372,"y":308,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":7,"w":38,"h":52},
@@ -34,7 +34,7 @@
},
"red-idle0005.png":
{
- "frame": {"x":112,"y":298,"w":38,"h":52},
+ "frame": {"x":318,"y":302,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":52},
@@ -42,7 +42,7 @@
},
"red-idle0006.png":
{
- "frame": {"x":166,"y":274,"w":38,"h":52},
+ "frame": {"x":264,"y":264,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":8,"w":38,"h":52},
@@ -50,7 +50,7 @@
},
"red-idle0007.png":
{
- "frame": {"x":220,"y":312,"w":38,"h":50},
+ "frame": {"x":314,"y":342,"w":38,"h":50},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":10,"w":38,"h":50},
@@ -58,7 +58,7 @@
},
"red-idle0008.png":
{
- "frame": {"x":382,"y":314,"w":38,"h":48},
+ "frame": {"x":256,"y":344,"w":38,"h":48},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":12,"w":38,"h":48},
@@ -66,7 +66,7 @@
},
"red-idle0009.png":
{
- "frame": {"x":438,"y":304,"w":38,"h":48},
+ "frame": {"x":206,"y":344,"w":38,"h":48},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":12,"w":38,"h":48},
@@ -74,15 +74,15 @@
},
"red-idle0010.png":
{
- "frame": {"x":58,"y":342,"w":38,"h":48},
- "rotated": true,
+ "frame": {"x":466,"y":354,"w":38,"h":48},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":12,"w":38,"h":48},
"sourceSize": {"w":64,"h":64}
},
"red-idle0011.png":
{
- "frame": {"x":112,"y":338,"w":38,"h":48},
+ "frame": {"x":416,"y":354,"w":38,"h":48},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":11,"w":38,"h":48},
@@ -90,7 +90,7 @@
},
"red-idle0012.png":
{
- "frame": {"x":166,"y":314,"w":38,"h":48},
+ "frame": {"x":366,"y":348,"w":38,"h":48},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":11,"w":38,"h":48},
@@ -98,7 +98,7 @@
},
"red-idle0013.png":
{
- "frame": {"x":462,"y":112,"w":38,"h":48},
+ "frame": {"x":462,"y":2,"w":38,"h":48},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":11,"w":38,"h":48},
@@ -106,7 +106,7 @@
},
"red-idle0014.png":
{
- "frame": {"x":274,"y":310,"w":38,"h":50},
+ "frame": {"x":262,"y":304,"w":38,"h":50},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":10,"w":38,"h":50},
@@ -114,7 +114,7 @@
},
"red-idle0015.png":
{
- "frame": {"x":330,"y":306,"w":38,"h":50},
+ "frame": {"x":154,"y":306,"w":38,"h":50},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":10,"w":38,"h":50},
@@ -122,7 +122,7 @@
},
"red-idle0016.png":
{
- "frame": {"x":222,"y":240,"w":38,"h":52},
+ "frame": {"x":156,"y":266,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":8,"w":38,"h":52},
@@ -130,7 +130,7 @@
},
"red-idle0017.png":
{
- "frame": {"x":278,"y":236,"w":38,"h":52},
+ "frame": {"x":210,"y":264,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":52},
@@ -138,7 +138,7 @@
},
"red-idle0018.png":
{
- "frame": {"x":174,"y":122,"w":38,"h":54},
+ "frame": {"x":330,"y":120,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":6,"w":38,"h":54},
@@ -146,7 +146,7 @@
},
"red-idle0019.png":
{
- "frame": {"x":456,"y":232,"w":38,"h":54},
+ "frame": {"x":274,"y":120,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":5,"w":38,"h":54},
@@ -154,15 +154,15 @@
},
"red-idle0020.png":
{
- "frame": {"x":350,"y":42,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":82,"y":392,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-idle0021.png":
{
- "frame": {"x":400,"y":202,"w":38,"h":54},
+ "frame": {"x":160,"y":122,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":5,"w":38,"h":54},
@@ -170,7 +170,7 @@
},
"red-jump0001.png":
{
- "frame": {"x":58,"y":262,"w":38,"h":52},
+ "frame": {"x":434,"y":274,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":8,"w":38,"h":52},
@@ -178,87 +178,87 @@
},
"red-jump0002.png":
{
- "frame": {"x":292,"y":42,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":82,"y":334,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-jump0003.png":
{
- "frame": {"x":58,"y":2,"w":38,"h":58},
- "rotated": true,
+ "frame": {"x":42,"y":42,"w":38,"h":58},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":6,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0004.png":
{
- "frame": {"x":2,"y":422,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":402,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":6,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0005.png":
{
- "frame": {"x":2,"y":362,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":342,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":5,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0006.png":
{
- "frame": {"x":2,"y":302,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":282,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0007.png":
{
- "frame": {"x":234,"y":42,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":82,"y":276,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":5,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-jump0008.png":
{
- "frame": {"x":2,"y":242,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":222,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0009.png":
{
- "frame": {"x":2,"y":182,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":162,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":3,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0010.png":
{
- "frame": {"x":2,"y":122,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":102,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0011.png":
{
- "frame": {"x":2,"y":62,"w":38,"h":58},
- "rotated": false,
+ "frame": {"x":42,"y":2,"w":38,"h":58},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":3,"w":38,"h":58},
"sourceSize": {"w":64,"h":64}
},
"red-jump0012.png":
{
- "frame": {"x":112,"y":258,"w":38,"h":52},
+ "frame": {"x":380,"y":268,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":38,"h":52},
@@ -266,7 +266,7 @@
},
"red-jump0013.png":
{
- "frame": {"x":386,"y":274,"w":38,"h":50},
+ "frame": {"x":210,"y":304,"w":38,"h":50},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":38,"h":50},
@@ -274,7 +274,7 @@
},
"red-jump0014.png":
{
- "frame": {"x":168,"y":234,"w":38,"h":52},
+ "frame": {"x":434,"y":234,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":38,"h":52},
@@ -282,7 +282,7 @@
},
"red-jump0015.png":
{
- "frame": {"x":344,"y":194,"w":38,"h":54},
+ "frame": {"x":218,"y":120,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":38,"h":54},
@@ -290,7 +290,7 @@
},
"red-jump0016.png":
{
- "frame": {"x":288,"y":158,"w":38,"h":54},
+ "frame": {"x":444,"y":156,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":5,"w":38,"h":54},
@@ -298,15 +298,15 @@
},
"red-jump0017.png":
{
- "frame": {"x":58,"y":82,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":82,"y":218,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-jump0018.png":
{
- "frame": {"x":224,"y":200,"w":38,"h":52},
+ "frame": {"x":326,"y":262,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":52},
@@ -314,7 +314,7 @@
},
"red-jump0019.png":
{
- "frame": {"x":58,"y":222,"w":38,"h":52},
+ "frame": {"x":380,"y":228,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":52},
@@ -322,7 +322,7 @@
},
"red-jump0020.png":
{
- "frame": {"x":114,"y":218,"w":38,"h":52},
+ "frame": {"x":156,"y":226,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":8,"w":38,"h":52},
@@ -330,7 +330,7 @@
},
"red-jump0021.png":
{
- "frame": {"x":170,"y":194,"w":38,"h":52},
+ "frame": {"x":326,"y":222,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":8,"w":38,"h":52},
@@ -338,7 +338,7 @@
},
"red-jump0022.png":
{
- "frame": {"x":458,"y":192,"w":38,"h":52},
+ "frame": {"x":216,"y":224,"w":38,"h":52},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":8,"w":38,"h":52},
@@ -346,7 +346,7 @@
},
"red-jump0023.png":
{
- "frame": {"x":232,"y":120,"w":38,"h":54},
+ "frame": {"x":388,"y":118,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":6,"w":38,"h":54},
@@ -354,15 +354,15 @@
},
"red-jump0024.png":
{
- "frame": {"x":116,"y":46,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":122,"y":42,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-run0001.png":
{
- "frame": {"x":402,"y":162,"w":38,"h":54},
+ "frame": {"x":332,"y":80,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":6,"w":38,"h":54},
@@ -370,7 +370,7 @@
},
"red-run0002.png":
{
- "frame": {"x":346,"y":154,"w":38,"h":54},
+ "frame": {"x":276,"y":80,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":54},
@@ -378,23 +378,23 @@
},
"red-run0003.png":
{
- "frame": {"x":466,"y":2,"w":40,"h":54},
- "rotated": false,
+ "frame": {"x":452,"y":74,"w":40,"h":54},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":40,"h":54},
"sourceSize": {"w":64,"h":64}
},
"red-run0004.png":
{
- "frame": {"x":466,"y":58,"w":40,"h":52},
- "rotated": false,
+ "frame": {"x":272,"y":222,"w":40,"h":52},
+ "rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":3,"w":40,"h":52},
"sourceSize": {"w":64,"h":64}
},
"red-run0005.png":
{
- "frame": {"x":290,"y":118,"w":38,"h":54},
+ "frame": {"x":162,"y":82,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":5,"w":38,"h":54},
@@ -402,39 +402,39 @@
},
"red-run0006.png":
{
- "frame": {"x":176,"y":42,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":86,"y":100,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":6,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-run0007.png":
{
- "frame": {"x":408,"y":2,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":82,"y":160,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-run0008.png":
{
- "frame": {"x":350,"y":2,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":42,"y":450,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":7,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-run0009.png":
{
- "frame": {"x":292,"y":2,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":42,"y":392,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":5,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-run0010.png":
{
- "frame": {"x":404,"y":122,"w":38,"h":54},
+ "frame": {"x":220,"y":80,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":4,"w":38,"h":54},
@@ -442,7 +442,7 @@
},
"red-run0011.png":
{
- "frame": {"x":460,"y":152,"w":38,"h":50},
+ "frame": {"x":426,"y":314,"w":38,"h":50},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":3,"w":38,"h":50},
@@ -450,7 +450,7 @@
},
"red-run0012.png":
{
- "frame": {"x":348,"y":114,"w":38,"h":54},
+ "frame": {"x":450,"y":116,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":4,"w":38,"h":54},
@@ -458,15 +458,15 @@
},
"red-run0013.png":
{
- "frame": {"x":234,"y":2,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":42,"y":334,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":5,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-run0014.png":
{
- "frame": {"x":2,"y":2,"w":38,"h":58},
+ "frame": {"x":2,"y":442,"w":38,"h":58},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":5,"w":38,"h":58},
@@ -474,15 +474,15 @@
},
"red-shoot0001.png":
{
- "frame": {"x":58,"y":42,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":42,"y":218,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":4,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-shoot0002.png":
{
- "frame": {"x":290,"y":82,"w":34,"h":56},
+ "frame": {"x":394,"y":42,"w":34,"h":56},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":19,"y":4,"w":34,"h":56},
@@ -490,7 +490,7 @@
},
"red-shoot0003.png":
{
- "frame": {"x":58,"y":192,"w":28,"h":54},
+ "frame": {"x":384,"y":198,"w":28,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":26,"y":6,"w":28,"h":54},
@@ -498,7 +498,7 @@
},
"red-shoot0004.png":
{
- "frame": {"x":116,"y":124,"w":30,"h":54},
+ "frame": {"x":272,"y":160,"w":30,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":6,"w":30,"h":54},
@@ -506,7 +506,7 @@
},
"red-shoot0005.png":
{
- "frame": {"x":454,"y":272,"w":30,"h":54},
+ "frame": {"x":160,"y":162,"w":30,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":6,"w":30,"h":54},
@@ -514,7 +514,7 @@
},
"red-shoot0006.png":
{
- "frame": {"x":398,"y":242,"w":30,"h":54},
+ "frame": {"x":216,"y":160,"w":30,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":6,"w":30,"h":54},
@@ -522,7 +522,7 @@
},
"red-shoot0007.png":
{
- "frame": {"x":114,"y":188,"w":28,"h":54},
+ "frame": {"x":328,"y":192,"w":28,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":26,"y":6,"w":28,"h":54},
@@ -530,7 +530,7 @@
},
"red-shoot0008.png":
{
- "frame": {"x":2,"y":482,"w":28,"h":54},
+ "frame": {"x":272,"y":192,"w":28,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":6,"w":28,"h":54},
@@ -538,7 +538,7 @@
},
"red-shoot0009.png":
{
- "frame": {"x":348,"y":82,"w":30,"h":56},
+ "frame": {"x":452,"y":42,"w":30,"h":56},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":4,"w":30,"h":56},
@@ -546,7 +546,7 @@
},
"red-shoot0010.png":
{
- "frame": {"x":58,"y":122,"w":36,"h":56},
+ "frame": {"x":278,"y":42,"w":36,"h":56},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":17,"y":4,"w":36,"h":56},
@@ -554,7 +554,7 @@
},
"red-shoot0011.png":
{
- "frame": {"x":116,"y":86,"w":36,"h":56},
+ "frame": {"x":220,"y":42,"w":36,"h":56},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":17,"y":4,"w":36,"h":56},
@@ -562,23 +562,23 @@
},
"red-throw0001.png":
{
- "frame": {"x":176,"y":2,"w":38,"h":56},
- "rotated": true,
+ "frame": {"x":42,"y":276,"w":38,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":4,"w":38,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-throw0002.png":
{
- "frame": {"x":118,"y":2,"w":42,"h":56},
- "rotated": true,
+ "frame": {"x":42,"y":102,"w":42,"h":56},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":19,"y":4,"w":42,"h":56},
"sourceSize": {"w":64,"h":64}
},
"red-throw0003.png":
{
- "frame": {"x":342,"y":234,"w":36,"h":54},
+ "frame": {"x":442,"y":196,"w":36,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":21,"y":6,"w":36,"h":54},
@@ -586,15 +586,15 @@
},
"red-throw0004.png":
{
- "frame": {"x":220,"y":280,"w":30,"h":52},
- "rotated": true,
+ "frame": {"x":122,"y":268,"w":30,"h":52},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":24,"y":7,"w":30,"h":52},
"sourceSize": {"w":64,"h":64}
},
"red-throw0005.png":
{
- "frame": {"x":58,"y":160,"w":30,"h":54},
+ "frame": {"x":160,"y":194,"w":30,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":24,"y":6,"w":30,"h":54},
@@ -602,23 +602,23 @@
},
"red-throw0006.png":
{
- "frame": {"x":276,"y":276,"w":32,"h":52},
- "rotated": true,
+ "frame": {"x":122,"y":214,"w":32,"h":52},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":7,"w":32,"h":52},
"sourceSize": {"w":64,"h":64}
},
"red-throw0007.png":
{
- "frame": {"x":332,"y":272,"w":32,"h":52},
- "rotated": true,
+ "frame": {"x":126,"y":100,"w":32,"h":52},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":23,"y":7,"w":32,"h":52},
"sourceSize": {"w":64,"h":64}
},
"red-throw0008.png":
{
- "frame": {"x":172,"y":162,"w":30,"h":54},
+ "frame": {"x":216,"y":192,"w":30,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":6,"w":30,"h":54},
@@ -626,7 +626,7 @@
},
"red-throw0009.png":
{
- "frame": {"x":116,"y":156,"w":30,"h":54},
+ "frame": {"x":328,"y":160,"w":30,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":25,"y":6,"w":30,"h":54},
@@ -634,15 +634,15 @@
},
"red-throw0010.png":
{
- "frame": {"x":286,"y":198,"w":36,"h":54},
- "rotated": true,
+ "frame": {"x":122,"y":158,"w":36,"h":54},
+ "rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":19,"y":5,"w":36,"h":54},
"sourceSize": {"w":64,"h":64}
},
"red-throw0011.png":
{
- "frame": {"x":232,"y":82,"w":36,"h":56},
+ "frame": {"x":336,"y":42,"w":36,"h":56},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":17,"y":4,"w":36,"h":56},
@@ -650,11 +650,83 @@
},
"red-throw0012.png":
{
- "frame": {"x":406,"y":82,"w":38,"h":54},
+ "frame": {"x":394,"y":78,"w":38,"h":54},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":16,"y":5,"w":38,"h":54},
"sourceSize": {"w":64,"h":64}
+},
+"red-walk0001.png":
+{
+ "frame": {"x":42,"y":160,"w":38,"h":56},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":16,"y":4,"w":38,"h":56},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0002.png":
+{
+ "frame": {"x":82,"y":42,"w":38,"h":56},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":16,"y":4,"w":38,"h":56},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0003.png":
+{
+ "frame": {"x":2,"y":382,"w":38,"h":58},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":15,"y":5,"w":38,"h":58},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0004.png":
+{
+ "frame": {"x":2,"y":320,"w":38,"h":60},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":15,"y":4,"w":38,"h":60},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0005.png":
+{
+ "frame": {"x":2,"y":194,"w":38,"h":62},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":16,"y":2,"w":38,"h":62},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0006.png":
+{
+ "frame": {"x":2,"y":130,"w":38,"h":62},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":16,"y":2,"w":38,"h":62},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0007.png":
+{
+ "frame": {"x":2,"y":66,"w":38,"h":62},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":15,"y":2,"w":38,"h":62},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0008.png":
+{
+ "frame": {"x":2,"y":2,"w":38,"h":62},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":15,"y":1,"w":38,"h":62},
+ "sourceSize": {"w":64,"h":64}
+},
+"red-walk0009.png":
+{
+ "frame": {"x":2,"y":258,"w":38,"h":60},
+ "rotated": false,
+ "trimmed": true,
+ "spriteSourceSize": {"x":16,"y":2,"w":38,"h":60},
+ "sourceSize": {"w":64,"h":64}
}},
"meta": {
"app": "http://www.texturepacker.com",
@@ -663,6 +735,6 @@
"format": "RGBA8888",
"size": {"w":512,"h":512},
"scale": "1",
- "smartupdate": "$TexturePacker:SmartUpdate:cd25359a661c3708d31ae00a2eaa3762$"
+ "smartupdate": "$TexturePacker:SmartUpdate:9867249e4af39a939dd4cba70ecb92da$"
}
}
View
BIN  images/red_anims.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
35 main.rb
@@ -26,7 +26,9 @@ def initialize pos
@jump_time = Time.now
@fire_time = Time.now
@last_faced_direction = 1
- @animation_time = Time.now
+ @animation_start = Time.now
+ @animation_time = 0
+ @current_animation = "red-idle"
end
def begin_contact other
@@ -51,9 +53,7 @@ def mat
def draw
m = self.mat
- delta = (Time.now - @animation_time).to_f / 2.0
- time = delta - delta.to_i
- frame = @sprite.timed_frame("red-idle", time)
+ frame = @sprite.timed_frame(@current_animation, (@animation_time - @animation_time.to_i))
w = frame.w
h = frame.h
@@ -73,13 +73,6 @@ def draw
m = m.scale(w, h, 1)
end
- #m = m.translate(0,0.5,0)
- #m = m.translate(0,h/28.0,0)
-
-
-
-
- #$platform.addSpriteDrawCommand(@sprite.texid, self.mat.flatten, [0.0,0.0,0.1,0.1])
$platform.addSpriteDrawCommand(@sprite.texid, m.flatten, [frame.x/@sprite.size[0], frame.y/@sprite.size[1], w/@sprite.size[0], h/@sprite.size[1]])
end
@@ -99,6 +92,7 @@ def move_left
def jump
if @num_standing_on_solid > 0 && (Time.now - @jump_time).to_f > 0.5
+ @animation_time = 0.0
@body.push([0.0,JUMP_IMP])
@jump_time = Time.now
end
@@ -114,6 +108,25 @@ def update time
vel = $one.body.vel
vel.x *= 1.0 - 1.0 * time #* factor
$one.body.vel = vel
+
+
+ delta = (Time.now - @animation_start).to_f
+ @animation_start = Time.now
+
+ if @num_standing_on_solid > 0
+ speed = (vel.x).abs
+ if speed > 2.5
+ @current_animation = "red-run"
+ delta *= speed / 8.0
+ else
+ @current_animation = "red-idle"
+ end
+ @animation_time += delta
+ else
+ @current_animation = "red-jump"
+ @animation_time += delta
+ @animation_time = [@animation_time, 0.99].min
+ end
end
def fire
Please sign in to comment.
Something went wrong with that request. Please try again.