From c124da1308068a259fea057454b3fb7c32f742be Mon Sep 17 00:00:00 2001 From: Isaiah Billingsley Date: Mon, 22 Aug 2022 22:22:12 -0400 Subject: [PATCH] Revert spider draw rounding to original version --- dist/one-slime-army.wasm | Bin 27157 -> 27283 bytes src/main.zig | 34 +++++++++++++++++----------------- wapm.toml | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dist/one-slime-army.wasm b/dist/one-slime-army.wasm index a9dab0d46f9486ae33574b7bded5ec8636fac5b6..f294bf439fdf62f5e212de31ed6f495a9daec6c1 100755 GIT binary patch delta 2777 zcmbVOO=ule6rMZt=4Iy1Omg$nw6#C)%xFqt5)moJSkpIC5-C){zfxTYfwn5IQnV|< z2a~!If0N!?+irX_D2QEDd>h4u+X{*iTc}VapbN!?!M{cq;yHJIo2Ep4A;Z0A&OP6E z&OJZ##ziJBvH2-OYqeU+Y^Aj@b5g6AwS_C=>XpO7Vxhfszp00;#qeM4oMJnTej~W> z$K0IaY5{Xi)z^G5#5ZO=WTTqm)grG8y5c|?)js?kwLlA=X?hiUWksG1cHDl;)m2~h zN##W{-zOM>y-x@M>mZH}7&{MM01r#Z1 zROc_#30IY(bW;U$SXJEaKyl4L8CFlri|7fIpt6e%fQoVAO^-~bj&MIlnUUN;DqH>} zU4+XG=!Tv^Kib3)Zt=QOx#AjPz`kcNlkR*mMn1?~XT_pitVrpBCk8T9l6Xx_j#e zs@h3y7_SL$nd%pd)E2d#hxeNNBoVZ+JSuq=V0qY)XXUt1EU`SWa<3^56>4CKcY6E* z8*>qwlqs0v92A7I#h*P5&A=A2i$BE-@ixB=pI`C)_#EkdkeTB7-to{Vyu^%dyE-7m zFtwAmYttG$2b{L+P+J*R+ut6?wqgeT`y6x{%z!oTOoYg7SbcYiUUvs~J&iicmvDpm zf44%4KgivlMOn0Fuq3x|yG`Y32A7kqlk66g9R`lxT}XDakWF!*?;)iAUSCU6_v|!O zwjW36bQRsnyNi_Rkg1S=sFF1t+VWE}M|7YtKvJ+G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RV=xNuWKBDv9wS!be~f2Rf&3C~XoAepKTv(k59Gc;~bj?C%xtZ(C%#@XOt!Rzye2 zxzgSUhtqRGkBn;-6d~ULLXld+6er6E_UO(c(X*r&Q_Vq)W|Wl{Voc9biqW`Aj3sV} z+Z?}(x`x+4pH%8_1yH7V(Wz=Sx5WkLFtdf%aTosgcRY#zcRTij{9hd-b$j!c-8_fh zE7ZK9YtlW3(5%q4sEI3TxcU;BSPwe)+So4F16I2?o(yCN&R|oB_3MwXgMCq&d`HP@kq9fE>^Zb4(gT88A&~pr{y;y zY`TE$WW6ls@=}>}gb=0_VcQ93TBI^$xpd04Dbre2HcHwHG&JgfOOK6KkkHeBE`oyU zjkXw?YxUNR0JgK0oYM3Xe+M;gIuir7FOV}vBxd^i#SdLC)UPsYHF&z_$z5(?)^q=9 z)-uB6YOtrxtfgfn^(B&4X4-YQc8*({+#17c*z}vN&iH>eU63{n`K~3_Ee>>#!m(fJ zo`C#6?LMdJ@a1QErlFJ_`qC00xTI-p z$|s%JYzL86-NFYiyd&})roIJcjFJi;ha6+1oBf;e`I z=)@b_EogrH>4J}!0=JtzeTNuZY@X=9ok3;q+e diff --git a/src/main.zig b/src/main.zig index 0d5d872..6c99cd4 100644 --- a/src/main.zig +++ b/src/main.zig @@ -231,30 +231,30 @@ const Spider = struct { } fn draw(self: @This()) void { - const x = self.pos.x; - const y = self.pos.y; + const x = round(i32, self.pos.x); + const y = round(i32, self.pos.y); const flip: f64 = if ((frame_count / 5 + self.id) % 2 == 0) 1 else -1; w4.DRAW_COLORS.* = 4; - drawLineF( - x + self.dir.x * (2 + flip) + self.dir.y * 4, - y + self.dir.y * (2 + flip) - self.dir.x * 4, - x - self.dir.x * (2 + flip) - self.dir.y * 4, - y - self.dir.y * (2 + flip) + self.dir.x * 4, + w4.line( + x + round(i32, self.dir.x * (2 + flip) + self.dir.y * 4), + y + round(i32, self.dir.y * (2 + flip) - self.dir.x * 4), + x - round(i32, self.dir.x * (2 + flip) + self.dir.y * 4), + y - round(i32, self.dir.y * (2 + flip) - self.dir.x * 4), ); - drawLineF( - x + self.dir.x * (2 - flip) - self.dir.y * 4, - y + self.dir.y * (2 - flip) + self.dir.x * 4, - x - self.dir.x * (2 - flip) + self.dir.y * 4, - y - self.dir.y * (2 - flip) - self.dir.x * 4, + w4.line( + x + round(i32, self.dir.x * (2 - flip) - self.dir.y * 4), + y + round(i32, self.dir.y * (2 - flip) + self.dir.x * 4), + x - round(i32, self.dir.x * (2 - flip) - self.dir.y * 4), + y - round(i32, self.dir.y * (2 - flip) + self.dir.x * 4), ); - drawCircleF(x, y, 5); + drawCircle(x, y, 5); drawPixel( - round(i32, x + self.dir.x * 4 + self.dir.y * 1.5), - round(i32, y + self.dir.y * 4 - self.dir.x * 1.5), + x + round(i32, self.dir.x * 4 + self.dir.y * 1.5), + y + round(i32, self.dir.y * 4 - self.dir.x * 1.5), ); drawPixel( - round(i32, x + self.dir.x * 4 - self.dir.y * 1.5), - round(i32, y + self.dir.y * 4 + self.dir.x * 1.5), + x + round(i32, self.dir.x * 4 - self.dir.y * 1.5), + y + round(i32, self.dir.y * 4 + self.dir.x * 1.5), ); } diff --git a/wapm.toml b/wapm.toml index 3dab10c..bf9f882 100644 --- a/wapm.toml +++ b/wapm.toml @@ -1,6 +1,6 @@ [package] name = "ibillingsley/one-slime-army" -version = "1.2.0" +version = "1.2.1" description = "One Slime Army is an arcade endless wave survival game for the WASM-4 fantasy console" license = "ISC" readme = "README.md"