From 03541f1f4dd32c738d779c259cb93b05880856d4 Mon Sep 17 00:00:00 2001 From: rsninja722 Date: Fri, 23 Apr 2021 23:36:24 -0400 Subject: [PATCH 1/5] diver + tiles --- assets/img/character/diveNormal.aseprite | Bin 0 -> 2333 bytes assets/img/character/diveNormal.json | 82 +++++++++++++++++++++ assets/img/character/diveNormal.png | Bin 0 -> 657 bytes assets/img/character/diveStroke.aseprite | Bin 0 -> 2333 bytes assets/img/character/diveStrokeCharge.json | 50 +++++++++++++ assets/img/character/diveStrokeCharge.png | Bin 0 -> 666 bytes assets/img/character/walk1.png | Bin 0 -> 388 bytes assets/img/tiles/tileset.png | Bin 0 -> 894 bytes 8 files changed, 132 insertions(+) create mode 100644 assets/img/character/diveNormal.aseprite create mode 100644 assets/img/character/diveNormal.json create mode 100644 assets/img/character/diveNormal.png create mode 100644 assets/img/character/diveStroke.aseprite create mode 100644 assets/img/character/diveStrokeCharge.json create mode 100644 assets/img/character/diveStrokeCharge.png create mode 100644 assets/img/character/walk1.png create mode 100644 assets/img/tiles/tileset.png diff --git a/assets/img/character/diveNormal.aseprite b/assets/img/character/diveNormal.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..49cf5d809e218f2d3762f415c096b646ef4d0dfe GIT binary patch literal 2333 zcmd^jH6OO z*d`!CHW(7eSzI-ATY(fX3}^+4P)>^u&E$|n%iaCTwn#{}z1kann*S%y|LKeG=iBF( zTIwLkqmp+KJ;W5jAsY|`34!PJf-}t_Vg#T6V;$RwAPZC4tEt)$UX~H4Q>~ZvfUNPbRqyVPq+YwBkh2SZ<)Xe$qnG*^d4Z|Z{9$b7!Tb0 z^;sY-+yUrA+Xf`MIswUKE)XA>0Q5Vn1P14;f%Nt#z}EgHpc)o}-` zr%w0)qxN3~mJ^9Ug>Nvh=duWxnR6I;m4jEapujtt-yH`VC;<&XAKXD4tU(!kK^9Cw z6C6Ph>_82?KnjdNN8_Sag9Ru+K7>Ou#6l(nLK;L_Ym#tUz`qwLAe#`+py<$ZI6^DD zXycI85m3XW{JC^sEH2#)4vddazwlh0h)_dA+=$w^vSDKrPF5R;^5$7^fZAr;@4qRIBd|m<}Sp*-zT)S#G;T z`EKlMq&94>bMDpkgB@7LNBl3YA3Q}w?}X)-)FP`|YKj#hv^)&GD8nvG6HO?7m~ zH@ZjF4``3rmR-4>c>79inzw6lnzA#oQ2L_e0Ad$@y0#zO7p69>&Xi`7-k@sAb=5lH z{hw~FAe*4O(S0-JJXWvi;MllOP&1`_*DN7Pc+uGJvL3C$=f(EO;YTUvMG0E8Y%(W% zETpY1qhC_Fh>f85hnvoHF5j(l{^)vd=l)FoQe1A=d?%OPGGIOFiT34_=1m>*+P@GE z&2a_qW2BO5!%|Ugjxub(oIRmq9T45f<2eO3Hu;M#M$Yy1#Eh_KWj|zLWkx`I9bQZW5>L9~V79^GQ6MO9#gpn7e? z$KnPD!pGbo>hz3Vi5r67mIi1{X63pvpqNec~_rLq*na3zse9SVR zsJd_O*od+9ifwK~x7H}4N&+g5CNJZkDCK*l#60PHiRq5Y;<5}9L5$*)=+7^Vat!Fv zF$JX)Ug~nIEO+bl{60Mz7Q_8K>_dhu)ugyKcJRDhJl-;N>rBjwjxRbmdU9RO;s2^h zFrw_sNMhK&dewJQaY@@REeZEU8~Rm^mGu`Mr6cXkr;|{_fe{Oxrl#q&eVX`d~^9h1q&7BLiKD{|@cE_K? zj(f%y4(`T0l;Gh?1v!eCBj$`T9+tkCYVueWZ~Ro%Nk)5AMh|Ayp$ks!wn-!xdeT0y raVE~mz3E|^vf`yd^~@e|1#hyeu8E{Z&3Q68Z&}^9WQgDRKchbYSyh}= literal 0 HcmV?d00001 diff --git a/assets/img/character/diveNormal.json b/assets/img/character/diveNormal.json new file mode 100644 index 0000000..0687c6a --- /dev/null +++ b/assets/img/character/diveNormal.json @@ -0,0 +1,82 @@ +{ "frames": { + "Sprite-0005 0.": { + "frame": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 1.": { + "frame": { "x": 11, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 2.": { + "frame": { "x": 22, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 3.": { + "frame": { "x": 33, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 4.": { + "frame": { "x": 44, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 5.": { + "frame": { "x": 55, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 6.": { + "frame": { "x": 66, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "Sprite-0005 7.": { + "frame": { "x": 77, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + } + }, + "meta": { + "app": "http://www.aseprite.org/", + "version": "1.2.27-x64", + "image": "diveNormal.png", + "format": "RGBA8888", + "size": { "w": 88, "h": 21 }, + "scale": "1", + "frameTags": [ + ], + "layers": [ + { "name": "Layer 1", "opacity": 255, "blendMode": "normal" } + ], + "slices": [ + ] + } +} diff --git a/assets/img/character/diveNormal.png b/assets/img/character/diveNormal.png new file mode 100644 index 0000000000000000000000000000000000000000..acf7ee8e0061aa5a1c8d0fa0f77d2c8ecb4cbe83 GIT binary patch literal 657 zcmV;C0&e|@P)Px%OG!jQR9J=Wn7vQiKp4iKM3qVx4;>OEqD65)RjX8p2}SH3^MSI$e-P2CFxIH1 z1Bfh$|DaL_rjU_V3>`XjYa}m-d+Zlh;pP z*_Hu9HLL2^tg6o*^CZjGtg0P+Zu9ozJSWs_-tY0eRaliCWX~-+8j034H4<>zFsW4} z88&Yht$_JJuERQ`owQ-Xsnjh1a4K~x@ZRBhI+Z##RXlGMR;35obE5)ggAxVzKiITk z{*kQf;_%w_kz9#7scit%q>=T1WfgmvsF8r(?0{NDx^LFa z4&Y`7(cm~L;#Jsb_Dcs`Fd*DNAU3nPXeZ+_;BE@HlkpgL(p1=K_d7Dd$#@K3fBf`= zhJ@1WWcCqTD8GA;*RNipb#aN^PvXmtW+$`M1iM$)0D#uTCCs_!;hrbW%CTX@*n00000NkvXXu0mjf!RS5# literal 0 HcmV?d00001 diff --git a/assets/img/character/diveStroke.aseprite b/assets/img/character/diveStroke.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..49cf5d809e218f2d3762f415c096b646ef4d0dfe GIT binary patch literal 2333 zcmd^jH6OO z*d`!CHW(7eSzI-ATY(fX3}^+4P)>^u&E$|n%iaCTwn#{}z1kann*S%y|LKeG=iBF( zTIwLkqmp+KJ;W5jAsY|`34!PJf-}t_Vg#T6V;$RwAPZC4tEt)$UX~H4Q>~ZvfUNPbRqyVPq+YwBkh2SZ<)Xe$qnG*^d4Z|Z{9$b7!Tb0 z^;sY-+yUrA+Xf`MIswUKE)XA>0Q5V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/img/character/diveStrokeCharge.json new file mode 100644 index 0000000..383ff0f --- /dev/null +++ b/assets/img/character/diveStrokeCharge.json @@ -0,0 +1,50 @@ +{ "frames": { + "diveStroke 0.aseprite": { + "frame": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "diveStroke 1.aseprite": { + "frame": { "x": 11, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "diveStroke 2.aseprite": { + "frame": { "x": 22, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + }, + "diveStroke 3.aseprite": { + "frame": { "x": 33, "y": 0, "w": 11, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 11, "h": 21 }, + "sourceSize": { "w": 11, "h": 21 }, + "duration": 100 + } + }, + "meta": { + "app": "http://www.aseprite.org/", + "version": "1.2.27-x64", + "image": "diveStrokeCharge.png", + "format": "RGBA8888", + "size": { "w": 44, "h": 21 }, + "scale": "1", + "frameTags": [ + ], + "layers": [ + { "name": "Layer 1", "opacity": 255, "blendMode": "normal" } + ], + "slices": [ + ] + } +} diff --git a/assets/img/character/diveStrokeCharge.png b/assets/img/character/diveStrokeCharge.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb8c77b91539a6a2e43926e616e107c392334a9 GIT binary patch literal 666 zcmV;L0%iS)P)Jp#cC^Z)k+xU7n}a8&Xwfy=7*Tn>0i5#-ynVxa%*3)(h26_50DyCT0rlS9 zc+Hb2Hcr?YjROFfdJ_P^=T9H0I4O}VRpGte7S;>50RV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%-rkl;ruiP40S#GwUV;wDo};pPYYAIVM9--Da8Io#8ggai1Bm$+DFzC%gY@J6Zo4kcNGd%BY3 z&V7YTlw^xSti@Sd;!PanXtta+?l_aI!c`*T_=j`P5pk8VY;gLv;7YcHixK3CVh%9O zdnrk>(oIn8d&?VlGfM?@PbFEh5+;_J!PCh!(>QfNy3$H#k|kVjjG|SdlGUd2yAaym zCTX6uHX_=;pwsbPUP7$1CC9F*F-Fefl2vRg|M0QPM_2mLZZu0+|EjEM}hs!l`zB$4BdLjUEyTwi(r6hBb$JAgB=eG~l zP(WiRoMt+_q$KwAm3Pc{wm;Jk3wP3g2yHS@5pnL{+Z*TpDMfl99uG_NyiP>$ABl}} UgRs9I&;S4c07*qoM6N<$g2aiq6aWAK literal 0 HcmV?d00001 From cee7188dbe7bab1d2bfb1f66251de1e1b876c1e1 Mon Sep 17 00:00:00 2001 From: rsninja722 Date: Sat, 24 Apr 2021 12:37:35 -0400 Subject: [PATCH 2/5] more --- assets/img/character/diveStroke.aseprite | Bin 2333 -> 5362 bytes assets/img/character/diveStroke.json | 186 ++++++++++++++++++ assets/img/character/diveStroke.png | Bin 0 -> 1306 bytes .../img/character/diveStrokeCharge.aseprite | Bin 0 -> 2333 bytes assets/img/character/walk1.png | Bin 388 -> 402 bytes 5 files changed, 186 insertions(+) create mode 100644 assets/img/character/diveStroke.json create mode 100644 assets/img/character/diveStroke.png create mode 100644 assets/img/character/diveStrokeCharge.aseprite diff --git a/assets/img/character/diveStroke.aseprite b/assets/img/character/diveStroke.aseprite index 49cf5d809e218f2d3762f415c096b646ef4d0dfe..c9230938750d9163f5f9f618f41575e1c681e455 100644 GIT binary patch literal 5362 zcmeI0eOOFc9LG;(nkT&@lV&uRNVYOf*%HP~n|Tr`deF91H!-Wc^eRj*nkJMd45C+! z71~95u`S_YQdZW4O;X#4o-#Fs)iiC4H2a%2wEexie{6H+IiETA+&{kG?>*<-d(V|m zLg@J!Gh~X)5Qel6Ld&3jF3_j$L?-b2H;SJ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9WQgDRKchbYSyh}= diff --git a/assets/img/character/diveStroke.json b/assets/img/character/diveStroke.json new file mode 100644 index 0000000..0717420 --- /dev/null +++ b/assets/img/character/diveStroke.json @@ -0,0 +1,186 @@ +{ "frames": { + "diveStroke 0.aseprite": { + "frame": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 1.aseprite": { + "frame": { "x": 17, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 2.aseprite": { + "frame": { "x": 34, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 3.aseprite": { + "frame": { "x": 51, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 4.aseprite": { + "frame": { "x": 68, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 5.aseprite": { + "frame": { "x": 85, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 6.aseprite": { + "frame": { "x": 102, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 7.aseprite": { + "frame": { "x": 119, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 8.aseprite": { + "frame": { "x": 136, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 9.aseprite": { + "frame": { "x": 153, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 10.aseprite": { + "frame": { "x": 170, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 11.aseprite": { + "frame": { "x": 187, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 12.aseprite": { + "frame": { "x": 204, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 13.aseprite": { + "frame": { "x": 221, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 14.aseprite": { + "frame": { "x": 238, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 15.aseprite": { + "frame": { "x": 255, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 16.aseprite": { + "frame": { "x": 272, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 17.aseprite": { + "frame": { "x": 289, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 18.aseprite": { + "frame": { "x": 306, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 19.aseprite": { + "frame": { "x": 323, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + }, + "diveStroke 20.aseprite": { + "frame": { "x": 340, "y": 0, "w": 17, "h": 21 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 17, "h": 21 }, + "sourceSize": { "w": 17, "h": 21 }, + "duration": 75 + } + }, + "meta": { + "app": "http://www.aseprite.org/", + "version": "1.2.27-x64", + "image": "diveStroke.png", + "format": "RGBA8888", + "size": { "w": 357, "h": 21 }, + "scale": "1", + "frameTags": [ + ], + "layers": [ + { "name": "Layer 1", "opacity": 255, "blendMode": "normal" } + ], + "slices": [ + ] + } +} diff --git a/assets/img/character/diveStroke.png b/assets/img/character/diveStroke.png new file mode 100644 index 0000000000000000000000000000000000000000..b9bcf674b5e4bdde0dc4536a4b7aa85c7597c043 GIT binary patch literal 1306 zcmV+#1?BpQP)Px()Ja4^RCt{2oWE-nO&G_&D}u2}VWA}WgCvS6F5D}Gh*;U!8DmJR|3T1~S9vX7 zwn!&lBmND7f_S-LW5mKDNW|vI77;Hw)NqFuDGq{m^A`-SZHknqL(FaDC~97q>4-YMC_U!<@9`SuEC{tE~Q!)yHi8^ssFO52{=k zJ9iE&mbp0R(n)K|6T{jOwm+VWYCPfb(;l^M*)n?Xq~{3i>?#!nBK0Fw6G zRK!+6r7qM42`Y7wP{g=CMKM^cKSf37oD2WR>SMNk8fnU(bAj*EFKS0Nh-dLFgQq!Hm2aQbp$+K*xhj8G2Km z8;;*L5fujLTo`~xpfZCQc{51l92F0;V8o7;M^7Bb>e{*(J#pN=5|kJPUYMX#7wV!( zRFKvDs)!qnFoPKffzcx>W(Xo4WWk6v<;B1M!ON8u-2cx{T@fk_5*LO_pfZCQc{4yH z=Rn7UOc`2JZhiX>0NDQg1>MS5b+>ehIXWU@Ae{&jhqAkoH~0R_iitm)`1kmwn60LhPvvU#86kO z!;2&8c3hCfEvhhs8B`gr^F_+lfQ*6%*)sY}IcPM6dJ*>a_PXy|-@Y3)3KfQwZKIa% zmOc5jjSMs$Lw>&1*^XbW{yi@j4l=9xI%Y6~AS0K2iD8(CiU*}(^pBL6JNWUcg@=zG zW4FD7I~Q)^YvUsxK6;EFuUf!zC#fFJ7^CloA{nFah9Vhqj!NyZO&Ua&2|rpY11*jL z{0gwRM^Pn57i1=nZ8C!ylo?s_#bw@hmBK%w7)5xYcKYJ#<%`~vr_V5P>n}Wc`V3bu zU$nkwF)c%0oYtkEkqmj8PI#V6oudjWbsz73qcDiq`z92pUZ>S(*}8uFZ?d(v%1qO<{VUVircY_lsfx{k^NI znqL()zbaPO*2U`DdY2>r06=~wziZSsA%>0Q@ygRPqUKjcd3vU&e#~ITpfIFt^TkEp zy6_K`RfHGzxph#fi>=N!{(a%&$k0&$z_F2&Xg5FM!Tb^?hQ|}bNimdwY&17jx zgc+N`hNt^}WPKVgfZ?6!9>GIkCNbF)dOkqaXnWI>}TvIZ(Mm_d=T-#O>nKhpY`PBwlT**gHyx2h!l zx>1(zn3T(MOxYj+Q2+2g)#xEBBd*tG1~UeU0qk$ix%Q7dy)Nl9?G%Epl1WnqvV2lS zlQ@Ga3Y`Npn6V#>gDh7*meo&tK;a4KxW_5u%IRdnW3gDQ{g!JVv-Q*e0r9TZ_%p5= Qv;Y7A07*qoM6N<$f;|gnF#rGn literal 0 HcmV?d00001 diff --git a/assets/img/character/diveStrokeCharge.aseprite b/assets/img/character/diveStrokeCharge.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..49cf5d809e218f2d3762f415c096b646ef4d0dfe GIT binary patch literal 2333 zcmd^jH6OO z*d`!CHW(7eSzI-ATY(fX3}^+4P)>^u&E$|n%iaCTwn#{}z1kann*S%y|LKeG=iBF( zTIwLkqmp+KJ;W5jAsY|`34!PJf-}t_Vg#T6V;$RwAPZC4tEt)$UX~H4Q>~ZvfUNPbRqyVPq+YwBkh2SZ<)Xe$qnG*^d4Z|Z{9$b7!Tb0 z^;sY-+yUrA+Xf`MIswUKE)XA>0Q5Vn1P14;f%Nt#z}EgHpc)o}-` zr%w0)qxN3~mJ^9Ug>Nvh=duWxnR6I;m4jEapujtt-yH`VC;<&XAKXD4tU(!kK^9Cw z6C6Ph>_82?KnjdNN8_Sag9Ru+K7>Ou#6l(nLK;L_Ym#tUz`qwLAe#`+py<$ZI6^DD zXycI85m3XW{JC^sEH2#)4vddazwlh0h)_dA+=$w^vSDKrPF5R;^5$7^fZAr;@4qRIBd|m<}Sp*-zT)S#G;T z`EKlMq&94>bMDpkgB@7LNBl3YA3Q}w?}X)-)FP`|YKj#hv^)&GD8nvG6HO?7m~ zH@ZjF4``3rmR-4>c>79inzw6lnzA#oQ2L_e0Ad$@y0#zO7p69>&Xi`7-k@sAb=5lH z{hw~FAe*4O(S0-JJXWvi;MllOP&1`_*DN7Pc+uGJvL3C$=f(EO;YTUvMG0E8Y%(W% zETpY1qhC_Fh>f85hnvoHF5j(l{^)vd=l)FoQe1A=d?%OPGGIOFiT34_=1m>*+P@GE z&2a_qW2BO5!%|Ugjxub(oIRmq9T45f<2eO3Hu;M#M$Yy1#Eh_KWj|zLWkx`I9bQZW5>L9~V79^GQ6MO9#gpn7e? z$KnPD!pGbo>hz3Vi5r67mIi1{X63pvpqNec~_rLq*na3zse9SVR zsJd_O*od+9ifwK~x7H}4N&+g5CNJZkDCK*l#60PHiRq5Y;<5}9L5$*)=+7^Vat!Fv zF$JX)Ug~nIEO+bl{60Mz7Q_8K>_dhu)ugyKcJRDhJl-;N>rBjwjxRbmdU9RO;s2^h zFrw_sNMhK&dewJQaY@@REeZEU8~Rm^mGu`Mr6cXkr;|{_fe{Oxrl#q&eVX`d~^9h1q&7BLiKD{|@cE_K? zj(f%y4(`T0l;Gh?1v!eCBj$`T9+tkCYVueWZ~Ro%Nk)5AMh|Ayp$ks!wn-!xdeT0y raVE~mz3E|^vf`yd^~@e|1#hyeu8E{Z&3Q68Z&}^9WQgDRKchbYSyh}= literal 0 HcmV?d00001 diff --git a/assets/img/character/walk1.png b/assets/img/character/walk1.png index ba8b83d4459eab84a48ebb982b79a218b410ac9f..1b338fee9c4a2a293ca54dcab800365fba1d63ae 100644 GIT binary patch delta 375 zcmV--0f_#D1Cj%fB!3BTNLh0L01m_e01m_fl`9S#0003*NklQ5On*jKH%&BE;pF%zl`IKk zS-WbbBpId^johImB?B)P&k=xLEOX{w1JLWVCBw9$7<@Rtk950+rYiJX4w}5d$zXPwq;d!M`~Xc=@ce+=<{iCGTgtWe{D8gPoj6%Q zX|NlL%Ig5yTVeT(0NS8HwNm=wHH0~Az=4o)2t3^=qY zx)d@r#6h|WnM4-_mo9z>2XSzC zf79>oeeT{rypWRZxQXq!$z=AOkdu~%qz}S~Jgkw^-F*|&(0{o&Kg&E8(yU8YDHnz9 zxXE}l6e1mXzj;dltU`&aQ3HTpr!8#9O%(Wi{ghZ<71Pk^w|q=(hnLS+02Z_9vc`33 ztwM>*y;F7G0-zgHt9$fYK6AkGsxVl>D_!?nK9*OdR`;0u9|~B^ri@2Jp+H%m^isR! z{p^ovnTF0h{$k49Y3X3TnY3009)uC5p%a7=56wq9fT1_hX?AhgtA~aR<=?u z3Ujc%zD58UoHWLp*X%!K!1PEqj^{53e#ax%E3f0*6V>$(W@2+TJS!$-00000NkvXX Hu0mjfk7%SL From c0ad24029ab158bece20db77f67724540c3a01b1 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 24 Apr 2021 12:39:53 -0400 Subject: [PATCH 3/5] working on animaiton --- src/lib/wrappers/animation.rs | 13 ++++++++--- src/lib/wrappers/complexanimation.rs | 32 ++++++++++++++++++++++++++++ src/lib/wrappers/mod.rs | 3 ++- 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/lib/wrappers/complexanimation.rs diff --git a/src/lib/wrappers/animation.rs b/src/lib/wrappers/animation.rs index 3632dee..b6672df 100644 --- a/src/lib/wrappers/animation.rs +++ b/src/lib/wrappers/animation.rs @@ -48,9 +48,9 @@ impl FrameAnimationWrapper { } /// Draw the next frame to the screen at `position` - pub fn draw(&mut self, handle: &mut RaylibDrawHandle, position: Vector2) { + pub fn draw(&mut self, handle: &mut RaylibDrawHandle, position: Vector2, rotation: f32) { let frame_id = self.get_current_frame_id(handle); - self.draw_frame(handle, position, frame_id); + self.draw_frame(handle, position, rotation, frame_id); } /// Draw a specified frame to the screen at `position` @@ -58,6 +58,7 @@ impl FrameAnimationWrapper { &mut self, handle: &mut RaylibDrawHandle, position: Vector2, + rotation: f32, frame_number: u32, ) { // Determine the col number @@ -76,7 +77,13 @@ impl FrameAnimationWrapper { height: self.size.y, }; + // Rotation origin + let origin = Vector2 { + x: self.size.x, + y: self.size.y + }; + // Render - handle.draw_texture_rec(&mut self.sprite_sheet, frame_box, position, Color::WHITE); + handle.draw_texture_pro(&mut self.sprite_sheet, frame_box, position, origin, rotation, Color::WHITE); } } diff --git a/src/lib/wrappers/complexanimation.rs b/src/lib/wrappers/complexanimation.rs new file mode 100644 index 0000000..ad87572 --- /dev/null +++ b/src/lib/wrappers/complexanimation.rs @@ -0,0 +1,32 @@ +use std::usize; + +use raylib::prelude::*; + +pub struct FrameRange { + pub min: usize, + pub max: usize, +} + +pub struct ComplexAnimationTool { + sprite_sheet: Texture2D, + frames_per_second: f32, + frame_size: Vector2, + sprite_sheet_size_frames: Vector2 +} + +impl ComplexAnimationTool { + pub fn render_loop(&self, context_2d: &mut RaylibMode2D, bounds: Rectangle, rotation: f32, range: &FrameRange) { + + } + + pub fn render_frame(&self, context_2d: &mut RaylibMode2D, bounds: Rectangle, rotation: f32, id: usize) { + + // Convert the ID to an xy + let col_id = id % self.sprite_sheet_size_frames.x as usize; + let row_id = id / self.sprite_sheet_size_frames.y as usize; + + + + + } +} diff --git a/src/lib/wrappers/mod.rs b/src/lib/wrappers/mod.rs index 9af9ea2..1a8f43a 100644 --- a/src/lib/wrappers/mod.rs +++ b/src/lib/wrappers/mod.rs @@ -1,2 +1,3 @@ pub mod audio; -pub mod animation; \ No newline at end of file +pub mod animation; +pub mod complexanimation; \ No newline at end of file From f97ff9dec4710ea0af0cb86049df27b90f45ff12 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 24 Apr 2021 12:48:22 -0400 Subject: [PATCH 4/5] animation --- src/lib/wrappers/animation.rs | 19 ++++++++++--------- src/logic/ingame/playerlogic.rs | 25 ++++++++++++++----------- src/resources.rs | 32 +++++++++++++++++++++++++++----- 3 files changed, 51 insertions(+), 25 deletions(-) diff --git a/src/lib/wrappers/animation.rs b/src/lib/wrappers/animation.rs index b6672df..3949089 100644 --- a/src/lib/wrappers/animation.rs +++ b/src/lib/wrappers/animation.rs @@ -1,9 +1,4 @@ -use raylib::{ - core::color::Color, - math::{Rectangle, Vector2}, - prelude::{RaylibDraw, RaylibDrawHandle}, - texture::Texture2D, -}; +use raylib::{core::color::Color, math::{Rectangle, Vector2}, prelude::{RaylibDraw, RaylibDrawHandle, RaylibMode2D}, texture::Texture2D}; /// A wrapper around an animation spritesheet pub struct FrameAnimationWrapper { @@ -48,7 +43,7 @@ impl FrameAnimationWrapper { } /// Draw the next frame to the screen at `position` - pub fn draw(&mut self, handle: &mut RaylibDrawHandle, position: Vector2, rotation: f32) { + pub fn draw(&mut self, handle: &mut RaylibMode2D, position: Vector2, rotation: f32) { let frame_id = self.get_current_frame_id(handle); self.draw_frame(handle, position, rotation, frame_id); } @@ -56,7 +51,7 @@ impl FrameAnimationWrapper { /// Draw a specified frame to the screen at `position` pub fn draw_frame( &mut self, - handle: &mut RaylibDrawHandle, + handle: &mut RaylibMode2D, position: Vector2, rotation: f32, frame_number: u32, @@ -76,6 +71,12 @@ impl FrameAnimationWrapper { width: self.size.x, height: self.size.y, }; + let frame_dest = Rectangle { + x: position.x, + y: position.y, + width: self.size.x, + height: self.size.y, + }; // Rotation origin let origin = Vector2 { @@ -84,6 +85,6 @@ impl FrameAnimationWrapper { }; // Render - handle.draw_texture_pro(&mut self.sprite_sheet, frame_box, position, origin, rotation, Color::WHITE); + handle.draw_texture_pro(&mut self.sprite_sheet, frame_box, frame_dest, origin, rotation, Color::WHITE); } } diff --git a/src/logic/ingame/playerlogic.rs b/src/logic/ingame/playerlogic.rs index 37c0a16..52d6262 100644 --- a/src/logic/ingame/playerlogic.rs +++ b/src/logic/ingame/playerlogic.rs @@ -144,16 +144,19 @@ pub fn render_player(context_2d: &mut RaylibMode2D, game_core: TRANSLUCENT_WHITE_96, ); + // Render the player + game_core.resources.player_animation_regular.draw(context_2d, player.position, player_rotation.to_degrees() + 90.0); + // TODO: tmp rect - context_2d.draw_rectangle_pro( - Rectangle { - x: player.position.x, - y: player.position.y, - width: player.size.x, - height: player.size.y, - }, - player.size / 2.0, - player_rotation.to_degrees() + 90.0, - Color::BLACK, - ); + // context_2d.draw_rectangle_pro( + // Rectangle { + // x: player.position.x, + // y: player.position.y, + // width: player.size.x, + // height: player.size.y, + // }, + // player.size / 2.0, + // player_rotation.to_degrees() + 90.0, + // Color::BLACK, + // ); } diff --git a/src/resources.rs b/src/resources.rs index 9ca9a7d..0857689 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -1,19 +1,41 @@ use failure::Error; -use raylib::{RaylibHandle, RaylibThread, texture::{Image, Texture2D}}; +use raylib::{ + math::Vector2, + texture::{Image, Texture2D}, + RaylibHandle, RaylibThread, +}; + +use crate::lib::wrappers::animation::FrameAnimationWrapper; /// This struct contains all textures and sounds that must be loaded into (V)RAM at the start of the game pub struct GlobalResources { - // Branding - pub game_logo: Texture2D + pub game_logo: Texture2D, + // Player + pub player_animation_regular: FrameAnimationWrapper, } impl GlobalResources { /// Load all resources. **THIS WILL HANG!** - pub fn load_all(raylib: &mut RaylibHandle, thread: &RaylibThread) -> Result { + pub fn load_all( + raylib: &mut RaylibHandle, + thread: &RaylibThread, + ) -> Result { Ok(GlobalResources { - game_logo: raylib.load_texture_from_image(&thread, &Image::load_image("./assets/img/logos/game-logo.png")?)? + game_logo: raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/logos/game-logo.png")?, + )?, + player_animation_regular: FrameAnimationWrapper::new( + raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/character/diveNormal.png")?, + )?, + Vector2 { x: 11.0, y: 21.0 }, + 8, + 100 / 8, + ), }) } } From 9cac7f83da7bb3fc6062a7c9ad76b218a6ccdb2f Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 24 Apr 2021 13:11:02 -0400 Subject: [PATCH 5/5] animated chr --- src/lib/wrappers/animation.rs | 8 ++-- src/logic/ingame/playerlogic.rs | 75 +++++++++++++++++++++++++-------- src/player.rs | 5 ++- src/resources.rs | 20 +++++++++ 4 files changed, 87 insertions(+), 21 deletions(-) diff --git a/src/lib/wrappers/animation.rs b/src/lib/wrappers/animation.rs index 3949089..053cf2b 100644 --- a/src/lib/wrappers/animation.rs +++ b/src/lib/wrappers/animation.rs @@ -24,7 +24,9 @@ impl FrameAnimationWrapper { /// Start the animation pub fn start(&mut self, handle: &RaylibDrawHandle) { - self.start_time_seconds = handle.get_time(); + if self.start_time_seconds == 0.0 { + self.start_time_seconds = handle.get_time(); + } } /// Stop (and reset) the animation @@ -80,8 +82,8 @@ impl FrameAnimationWrapper { // Rotation origin let origin = Vector2 { - x: self.size.x, - y: self.size.y + x: self.size.x / 2.0, + y: self.size.y / 2.0 }; // Render diff --git a/src/logic/ingame/playerlogic.rs b/src/logic/ingame/playerlogic.rs index e71554b..1460984 100644 --- a/src/logic/ingame/playerlogic.rs +++ b/src/logic/ingame/playerlogic.rs @@ -9,7 +9,7 @@ const NORMAL_PLAYER_SPEED: i32 = 3; const BOOST_PLAYER_SPEED: i32 = NORMAL_PLAYER_SPEED * 2; const CAMERA_FOLLOW_SPEED: f32 = 0.7; const TURN_SPEED: f32 = 0.15; -const BOOST_DECREASE_PER_SECOND: f32 = 0.75; +const BOOST_DECREASE_PER_SECOND: f32 = 0.65; const BOOST_REGEN_PER_SECOND: f32 = 0.25; const BREATH_DECREASE_PER_SECOND: f32 = 0.01; @@ -84,10 +84,36 @@ pub fn update_player_movement( // Decrease the boost game_core.player.boost_percent -= BOOST_DECREASE_PER_SECOND * dt as f32; + game_core.player.is_boosting = true; + if game_core.player.boost_percent >= 0.9 { + game_core + .resources + .player_animation_boost_charge + .start(draw_handle); + game_core.resources.player_animation_regular.stop(); + game_core.player.is_boost_charging = true; + } else { + game_core.resources.player_animation_boost_charge.stop(); + game_core + .resources + .player_animation_boost + .start(draw_handle); + game_core.player.is_boost_charging = false; + } } else { // Set the speed multiplier speed_multiplier = NORMAL_PLAYER_SPEED as f32; + // Reset boost animation + game_core.player.is_boosting = false; + game_core.player.is_boost_charging = false; + game_core.resources.player_animation_boost_charge.stop(); + game_core.resources.player_animation_boost.stop(); + game_core + .resources + .player_animation_regular + .start(draw_handle); + // Handle boost regen if !user_request_boost { game_core.player.boost_percent = (game_core.player.boost_percent @@ -104,6 +130,9 @@ pub fn update_player_movement( let player_real_movement = game_core.player.direction * speed_multiplier; if raw_movement_direction.distance_to(Vector2::zero()) > game_core.player.size.y / 2.0 { game_core.player.position += player_real_movement; + game_core.player.is_moving = true; + } else { + game_core.player.is_moving = false; } // Move the camera to follow the player @@ -139,7 +168,7 @@ pub fn render_player(context_2d: &mut RaylibMode2D, game_core: x: player.position.x as i32 as f32, y: player.position.y as i32 as f32, }, - boost_ring_max_radius , + boost_ring_max_radius, boost_ring_max_radius + 1.0, 0, (360.0 * player.breath_percent) as i32, @@ -147,19 +176,31 @@ pub fn render_player(context_2d: &mut RaylibMode2D, game_core: TRANSLUCENT_WHITE_96, ); - // Render the player - game_core.resources.player_animation_regular.draw(context_2d, player.position, player_rotation.to_degrees() + 90.0); - - // TODO: tmp rect - // context_2d.draw_rectangle_pro( - // Rectangle { - // x: player.position.x, - // y: player.position.y, - // width: player.size.x, - // height: player.size.y, - // }, - // player.size / 2.0, - // player_rotation.to_degrees() + 90.0, - // Color::BLACK, - // ); + // Render the player based on what is happening + if player.is_boost_charging { + game_core.resources.player_animation_boost_charge.draw( + context_2d, + player.position, + player_rotation.to_degrees() - 90.0, + ); + } else if player.is_boosting { + game_core.resources.player_animation_boost.draw( + context_2d, + player.position, + player_rotation.to_degrees() - 90.0, + ); + } else if player.is_moving { + game_core.resources.player_animation_regular.draw( + context_2d, + player.position, + player_rotation.to_degrees() - 90.0, + ); + } else { + game_core.resources.player_animation_regular.draw_frame( + context_2d, + player.position, + player_rotation.to_degrees() - 90.0, + 0, + ); + } } diff --git a/src/player.rs b/src/player.rs index d37f539..95c34a2 100644 --- a/src/player.rs +++ b/src/player.rs @@ -9,7 +9,10 @@ pub struct Player { pub size: Vector2, pub coins: u32, pub boost_percent: f32, - pub breath_percent: f32 + pub breath_percent: f32, + pub is_moving: bool, + pub is_boosting: bool, + pub is_boost_charging: bool } impl Player { diff --git a/src/resources.rs b/src/resources.rs index 0857689..7397358 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -14,6 +14,8 @@ pub struct GlobalResources { // Player pub player_animation_regular: FrameAnimationWrapper, + pub player_animation_boost_charge: FrameAnimationWrapper, + pub player_animation_boost: FrameAnimationWrapper, } impl GlobalResources { @@ -36,6 +38,24 @@ impl GlobalResources { 8, 100 / 8, ), + player_animation_boost_charge: FrameAnimationWrapper::new( + raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/character/diveStrokeCharge.png")?, + )?, + Vector2 { x: 11.0, y: 21.0 }, + 21, + 100 / 4, + ), + player_animation_boost: FrameAnimationWrapper::new( + raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/character/diveStroke.png")?, + )?, + Vector2 { x: 17.0, y: 21.0 }, + 21, + 30, + ), }) } }