From 321200139be2a423822f742d830ecf72fd314244 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Fri, 28 Feb 2025 12:03:23 +0000 Subject: [PATCH] draw animation frames for whip attack --- fcore/box.sml | 163 +++++++++++++++++++ fcore/level/player/sprites/raster/attack.png | Bin 0 -> 1613 bytes fcore/level/player/whip.sml | 4 + oms.mlb | 1 + 4 files changed, 168 insertions(+) create mode 100644 fcore/box.sml create mode 100644 fcore/level/player/sprites/raster/attack.png create mode 100644 fcore/level/player/whip.sml diff --git a/fcore/box.sml b/fcore/box.sml new file mode 100644 index 0000000..dedcab3 --- /dev/null +++ b/fcore/box.sml @@ -0,0 +1,163 @@ +structure Box = +struct + fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight) : Real32.real vector = + let + val endY = windowHeight - startY + val startY = windowHeight - (startY + drawHeight) + val endX = startX + drawWidth + val windowHeight = windowHeight / 2.0 + val windowWidth = windowWidth / 2.0 + in + #[ (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +1.0, +1.0, +1.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0, +1.0, +1.0, +1.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +1.0, +1.0, +1.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0, +1.0, +1.0, +1.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0, +1.0, +1.0, +1.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +1.0, +1.0, +1.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 1.0)) + (endY * 1.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 1.0)) + (endY * 1.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 1.0)) + (endY * 1.0)) / windowHeight) - 1.0, +0.0, +0.0, +0.0, + (((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0, +0.0, +0.0, +0.0 + ] + end +end diff --git a/fcore/level/player/sprites/raster/attack.png b/fcore/level/player/sprites/raster/attack.png new file mode 100644 index 0000000000000000000000000000000000000000..01b261bc11f30e0713f3544a59772cf6aa9b2470 GIT binary patch literal 1613 zcmbVMYfw{H5I%W9f|6iBErJ>(YNt?3r7bnqkjq1oS`a}Qc?ou6Rf-x*#lR4ViJ;b3 z%xFPE1hgU*(5N62s1QeMB9CA(;UN=Hp#=h%2nmk>+H=cHe{}rO_Q$<@?w;MfyZh~a zC&I%*937T800100?4Sq$@KSi@5$)hRcuh<;6eJ!yIt2joL-fI1@FKebKzPduLbmb? zMhu43XACF1CldWc)~>>n=WmRA69X-No+AQ-%avQ)p)pWBRC9v@!vOw^6e|Wjgo|k; zD1=T375(%O(NPhA=b+*!5lsLP7tm2#rxk206to}-9txJ`rrti>Fp~PMZF;DtX6Zbr zQ?VIy4!@n#J+74pSIECoEsj3|Z^nqy=LCcRPZ=;+?30B=0DLadNFw|~s4LLs?!!U( zk3SrLXKI-hOlX=|&^2<`=9C}TUS)IoGJJR9B3J+`;InKntte^P^@}=*EOi;!WIYIN z0Y5kdR_DHAI`Y+e%HFP0Umq!rL@moaC{J^a6qJ7+XdSC;c*G6a_NdObj_f1;RIsMk zkkC%!92wstIJL3hq+X4d95cu^_8FcBypQp3XJmbo-L3CWyKoF9uKGempWIlYy4+Aw zm(IuD$$JXGRyzCTO4-uett7P6Tp9_BUsOrezz(jTj1!<)0Ud3wp$|j4AOg9U1T#~e z>gt}^iM}GO$_pYPJl*Mn9e$9{%zd5d9V+>Wg?cHc&dg!d`aK=fJ22TB)S~SzZR)RG z=Ll3Ei0C=DJ0V&^0a41>D;RY&pJLr@t~GU~lg%BqLxVrJ%Z)l$elWyP@v$sGDA@kA ze{J{Kt0bulk)Nww06mqhc#hY1#~sLPpZ z+F*4#LDbOX%q+hd8yzpx#}mpD3YAfXCd;)edk+}#aK<{MGJn{jfz1;9{A-?9OX7`+ z#%T@LTELvOUfgs~nX*P#6b9$+M1@iUc)L&AN14xg`A||l+1Tf?+i=l-?tpc^2=@|> zziP|%oGYw-ZOh=b2iy3NM25>EE5hw?reh@eZl3_436$tGyLayV0)e2i$Z!O50IqF; z4hL9F5uNrSRP*{VJ+3;}QD^#n9Cp6&U@}$P8e`ID^(0w`a29T;%xj20Pny{nLlYWd zD=PO0REO)y%4NT|m1$LcI01z(=eZJbBGu)hwPOJ?s+k*jirBRCKTt84;%a(RW5;p8 z1MW(9LX=`$n5J-B3Q0n7>#!d$%isM~)s)-otkI7S?T;Mc?_7ycU5a}t<6no3{SfM* zVwR%;Zsm*VglC1#u#v!A>`6)_AMu6(a0r!N@|P_Rgv)6sjwPo;1L0fP=lLrnkTO!o zls2dVpcI*7o_F)YOcLZmv-)_#l%=tFs?^sUiEfZ%$KM;&Vu1^d#z`7QGl%pxxyLOz zNWFacS2)r%H-sABF$~qJH~Vu94AcNq=lMU$@!cu@3s(K_j(z@Ryok{Dyu5HUWlnHd J(2amZ(Vw-zQr!Rm literal 0 HcmV?d00001 diff --git a/fcore/level/player/whip.sml b/fcore/level/player/whip.sml new file mode 100644 index 0000000..2bf3b4f --- /dev/null +++ b/fcore/level/player/whip.sml @@ -0,0 +1,4 @@ +structure Whip = +struct + type box = {x: int, y: int, size: int} +end diff --git a/oms.mlb b/oms.mlb index f0eb2c2..49d60ec 100644 --- a/oms.mlb +++ b/oms.mlb @@ -19,6 +19,7 @@ in vendored/cozette-sml/fonts/cozette-ascii.mlb fcore/block.sml fcore/field.sml + fcore'box.sml fcore/level/chain-edge.sml end