From 0af73bf27dbf38649cde3006bc9e30f1f064bbf2 Mon Sep 17 00:00:00 2001 From: Solargale Date: Wed, 22 Apr 2020 17:44:03 -0600 Subject: [PATCH] Added diagonal movement and figured out how to make spriteSheets work --- Collector/Content/Content.mgcb | 396 --------------------- Collector/Content/man/man-0.png | Bin 248 -> 0 bytes Collector/Content/man/man-1.png | Bin 262 -> 0 bytes Collector/Content/man/man-10.png | Bin 268 -> 0 bytes Collector/Content/man/man-11.png | Bin 285 -> 0 bytes Collector/Content/man/man-12.png | Bin 268 -> 0 bytes Collector/Content/man/man-13.png | Bin 281 -> 0 bytes Collector/Content/man/man-14.png | Bin 268 -> 0 bytes Collector/Content/man/man-15.png | Bin 280 -> 0 bytes Collector/Content/man/man-16.png | Bin 248 -> 0 bytes Collector/Content/man/man-17.png | Bin 259 -> 0 bytes Collector/Content/man/man-18.png | Bin 248 -> 0 bytes Collector/Content/man/man-19.png | Bin 263 -> 0 bytes Collector/Content/man/man-2.png | Bin 248 -> 0 bytes Collector/Content/man/man-20.png | Bin 246 -> 0 bytes Collector/Content/man/man-21.png | Bin 262 -> 0 bytes Collector/Content/man/man-22.png | Bin 246 -> 0 bytes Collector/Content/man/man-23.png | Bin 260 -> 0 bytes Collector/Content/man/man-24.png | Bin 268 -> 0 bytes Collector/Content/man/man-25.png | Bin 279 -> 0 bytes Collector/Content/man/man-26.png | Bin 268 -> 0 bytes Collector/Content/man/man-27.png | Bin 285 -> 0 bytes Collector/Content/man/man-28.png | Bin 268 -> 0 bytes Collector/Content/man/man-29.png | Bin 281 -> 0 bytes Collector/Content/man/man-3.png | Bin 263 -> 0 bytes Collector/Content/man/man-30.png | Bin 268 -> 0 bytes Collector/Content/man/man-31.png | Bin 280 -> 0 bytes Collector/Content/man/man-4.png | Bin 267 -> 0 bytes Collector/Content/man/man-5.png | Bin 281 -> 0 bytes Collector/Content/man/man-6.png | Bin 267 -> 0 bytes Collector/Content/man/man-7.png | Bin 283 -> 0 bytes Collector/Content/man/man-8.png | Bin 268 -> 0 bytes Collector/Content/man/man-9.png | Bin 279 -> 0 bytes Collector/Main.cs | 27 +- Collector/src/Character/InputController.cs | 264 ++++++++------ Collector/src/Dimension/BlockMaterials.cs | 13 +- Collector/src/Dimension/WorldRenderer.cs | 10 +- 37 files changed, 171 insertions(+), 539 deletions(-) delete mode 100644 Collector/Content/man/man-0.png delete mode 100644 Collector/Content/man/man-1.png delete mode 100644 Collector/Content/man/man-10.png delete mode 100644 Collector/Content/man/man-11.png delete mode 100644 Collector/Content/man/man-12.png delete mode 100644 Collector/Content/man/man-13.png delete mode 100644 Collector/Content/man/man-14.png delete mode 100644 Collector/Content/man/man-15.png delete mode 100644 Collector/Content/man/man-16.png delete mode 100644 Collector/Content/man/man-17.png delete mode 100644 Collector/Content/man/man-18.png delete mode 100644 Collector/Content/man/man-19.png delete mode 100644 Collector/Content/man/man-2.png delete mode 100644 Collector/Content/man/man-20.png delete mode 100644 Collector/Content/man/man-21.png delete mode 100644 Collector/Content/man/man-22.png delete mode 100644 Collector/Content/man/man-23.png delete mode 100644 Collector/Content/man/man-24.png delete mode 100644 Collector/Content/man/man-25.png delete mode 100644 Collector/Content/man/man-26.png delete mode 100644 Collector/Content/man/man-27.png delete mode 100644 Collector/Content/man/man-28.png delete mode 100644 Collector/Content/man/man-29.png delete mode 100644 Collector/Content/man/man-3.png delete mode 100644 Collector/Content/man/man-30.png delete mode 100644 Collector/Content/man/man-31.png delete mode 100644 Collector/Content/man/man-4.png delete mode 100644 Collector/Content/man/man-5.png delete mode 100644 Collector/Content/man/man-6.png delete mode 100644 Collector/Content/man/man-7.png delete mode 100644 Collector/Content/man/man-8.png delete mode 100644 Collector/Content/man/man-9.png diff --git a/Collector/Content/Content.mgcb b/Collector/Content/Content.mgcb index f6fb229..9fcab5a 100644 --- a/Collector/Content/Content.mgcb +++ b/Collector/Content/Content.mgcb @@ -61,402 +61,6 @@ /processorParam:TextureFormat=Color /build:jungleGrass.png -#begin man.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man.png - -#begin man/man-0.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-0.png - -#begin man/man-1.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-1.png - -#begin man/man-10.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-10.png - -#begin man/man-11.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-11.png - -#begin man/man-12.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-12.png - -#begin man/man-13.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-13.png - -#begin man/man-14.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-14.png - -#begin man/man-15.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-15.png - -#begin man/man-16.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-16.png - -#begin man/man-17.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-17.png - -#begin man/man-18.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-18.png - -#begin man/man-19.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-19.png - -#begin man/man-2.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-2.png - -#begin man/man-20.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-20.png - -#begin man/man-21.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-21.png - -#begin man/man-22.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-22.png - -#begin man/man-23.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-23.png - -#begin man/man-24.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-24.png - -#begin man/man-25.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-25.png - -#begin man/man-26.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-26.png - -#begin man/man-27.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-27.png - -#begin man/man-28.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-28.png - -#begin man/man-29.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-29.png - -#begin man/man-3.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-3.png - -#begin man/man-30.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-30.png - -#begin man/man-31.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-31.png - -#begin man/man-4.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-4.png - -#begin man/man-5.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-5.png - -#begin man/man-6.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-6.png - -#begin man/man-7.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-7.png - -#begin man/man-8.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-8.png - -#begin man/man-9.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:MakeSquare=False -/processorParam:TextureFormat=Color -/build:man/man-9.png - #begin roof.png /importer:TextureImporter /processor:TextureProcessor diff --git a/Collector/Content/man/man-0.png b/Collector/Content/man/man-0.png deleted file mode 100644 index 3f2ee3277d2913952ee19deb64930f2fe62fc23c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7ebg z#W5tJ_3bokz6JvxXXzt<*UK#9yI^)BOpEQ2;HOGcRj=%&{i#lU>em)c4m+F5q4sd? zPL@K0gVs~n9`s3V;dBUPG+;P=du`qS4H*jaO-+nf%Gq|@*=t_CZ-T-K$Cik*P74|X zidmcfai@KAKYy8VQ|Y3{6P%*r3G5fF51eDU(HM8<%rx~-wnz@j_yu81Qq4l<&X?4r4-#}M0c)I$ztaD0e0sxZEU3&lk diff --git a/Collector/Content/man/man-1.png b/Collector/Content/man/man-1.png deleted file mode 100644 index bd111f1da2d63ea3258de6e4aafad9633c5bd58c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eGZ z#W5tJ^=+87*Z~EO$@}j8KUGq+qRUrlpI+LQ8YhP=O?LakEb{(6uGX$6Q-yjChZl7o zIV$nqL5i_FWPvYBhzt`?W5KSg|NNW%9xQH2Q#-m?eB$owDR0?3S+;fvtc(;|p*ST* z(eZxM#6O!qmoVMj5$L?c$(1#Nv4ri$Tn6oc=Gl=ED>qG8^8G-H;Kjn5p?}U@(!O}J zrZMXv$E&ZaPwZ>^BA}xkaOC=juHxvYLX6v3fA#-=pm2aW>bt(p${br2pdT1KUHx3v IIVCg!0K-#e^Z)<= diff --git a/Collector/Content/man/man-10.png b/Collector/Content/man/man-10.png deleted file mode 100644 index bcfe857f79a4da42bb3d52261e80fd43c2ae51ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eql z#W5tJ^=+6VUxNbA?VkVtKiOz>HeKGzv-iSm!Q1OLbe=eJKH!t}=|{;t6^}&JvmW@$ zJd1T?-p!p|yP|0K&XkVt3}y;NYp1QqpF$Peg@Y`AdA(Ox zPBjV^%sQ;T@KneQam$t{;rl8V*PJvlV7ct@ZLP#JXWrOn}`; z{08f3_KCcHf4iS@%2>_kYEs%HzwCsh;0LvyU;nZvZ;*buS>f>nPsOno=q+a~t~xi_k%1#KAf_v);ewN#wp`f8s; g-=6OHIKP7N&T$)OgYKQdK(8@)y85}Sb4q9e0BT5X82|tP diff --git a/Collector/Content/man/man-12.png b/Collector/Content/man/man-12.png deleted file mode 100644 index 6dddff982a85a84f2688b9915e072a04b67028ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eql z#W5tJ_3gBae60#R&ex^?|DXQRvzhDqw!Rq>zcOx=nJp18{JJUO$dn^7MFHz~@GfMz zBf4EdEcN5EpmjP8TbVy@UL=*}$jiFIx@`A!#yfhK8M3Y#_#Y5qV6YHj{*duUaGBs= zOIGLF1pRxjcKygTe~DWM4frrB+n diff --git a/Collector/Content/man/man-13.png b/Collector/Content/man/man-13.png deleted file mode 100644 index 0c84de9203d356dd1ff08d65eeba985bdbd8b63f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D0te_ z#W5tJ^=+6V-(dre!%HOu= z)n}(z317U$-tm6MH|^d>iyu3x`IU!l5Szrx$$2$b!@jA6?a-Yz<74hqHJLzcOx=nJp18{JJUO$dn^7MFHz~@GfMz zBf4EdEcN5EpmjP8TbVy@UL=*}$jiFIx@`A!#yfhK8M3Y#_#Y5qV6YHj{*duUaGBs= zOIGLF1pRxjcKygTe~DWM4frrB+n diff --git a/Collector/Content/man/man-15.png b/Collector/Content/man/man-15.png deleted file mode 100644 index 53243c6ca0d7a9d4cb7e9221cd03823778405d30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D0s@# z#W5tJ^=+6VU$X&E_wv90Pv7m-bg<4@&SCgaIZMb|HBU({hDX9MH%ZSjBjk?SLKYd( z?H+rk9_Eg^UCg*fx?{TNRmc7-D_J%rh41w_5Ng@$;HDO=xJ-bdA=Hpz={NToZeNnQ z{Ju8kf1LN~OYA94Nx|alTAbe$LhmRl`X79;eD@vB*bDiLi!Z!ny36=YKET(rig$XT zv}UQy#arwh&u5&|j{Im=xLkO*vHJ$GNvr;+-$~~Y-t^~FQ^4D&(;DXFe-k|uKU40H at)0gtYnSPTxoSXPF?hQAxvX4&ub-(`85mM_G;>yAzw2pXRYA*N5ngrak##%{`j$^Sna)f) zyic5Cf}X?yov0RHhMQIlA_tzxyVDja-wO4?aKNlL=& zoWp_k3)=r*R9ZP~dzX=r(&{66NVH=f~MIZ`!~7rTMmmH1({k;AFVlbf@vd3lA4L!AE+wYc%!#0X@Lr>FVdQ&MBb@ E0D{Y4;Q#;t diff --git a/Collector/Content/man/man-18.png b/Collector/Content/man/man-18.png deleted file mode 100644 index e126b675e5072c15a881c00e6f218791b5b55616..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7ebg z#W5tJ_3bokz6JvxXW=7%*UO0Q`qG}eG^x{_<6QUEOS7idP3ykzI&D7FhAh3xO$_m8 zGw*k^c!=`~G`1CRC`7X=FxISTUVQt*TYIJ*yPvrKXIENe`a0f2z~^Jhr-Kt(9Jm)g z<6_y%k^b@hyyeU(uidyOa!wU_z;eO#z&z0crn7hMPM@sBF1nSsyw_@l@^{Afz3QGk trZXAbLl|yuPrB9btMJ_^LTlzt=8ye)rhTbtTY;`-@O1TaS?83{1OP?p`;4MF{NQtYgpmVC~K)Cz*O? zUEaseIYCeAfR5B5rG}hb2F`>HeADs{@2=-%aQL+NJfm^-te@gSEWvkVDpNh2T)3Uj zigHv5ZhQ3J)}Q^vHA&r`o&Zn9ISwVf8~%3{F!ftDT%V|AuazbJP0DhG>UYM9$8JKQ zXFaZnlt`UU+Mf6>cgY9N9}E4N&!)X(%-BD3vO%rYwtp+Rg$fL;XIt*d0eXVL)78&q Iol`;+0MtWa0RR91 diff --git a/Collector/Content/man/man-2.png b/Collector/Content/man/man-2.png deleted file mode 100644 index 3f2ee3277d2913952ee19deb64930f2fe62fc23c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7ebg z#W5tJ_3bokz6JvxXXzt<*UK#9yI^)BOpEQ2;HOGcRj=%&{i#lU>em)c4m+F5q4sd? zPL@K0gVs~n9`s3V;dBUPG+;P=du`qS4H*jaO-+nf%Gq|@*=t_CZ-T-K$Cik*P74|X zidmcfai@KAKYy8VQ|Y3{6P%*r3G5fF51eDU(HM8<%rx~-wnz@j_yu81Qq4l<&X?4r4-#}M0c)I$ztaD0e0sxZEU3&lk diff --git a/Collector/Content/man/man-20.png b/Collector/Content/man/man-20.png deleted file mode 100644 index 18fe18ecc37a4b132eba440573ba9abc94567e16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eDY z#W5tJ^=+7;P=f)7_Pqc9jr?S{=&D&(@l6U;T(a?5#@Y{tJ}*AH=+<=iKZb&4sehr~3`*PU799{4sIws9u&$M${`VOF*89ZJ6T-G@yGywqhy;f}i diff --git a/Collector/Content/man/man-21.png b/Collector/Content/man/man-21.png deleted file mode 100644 index 3149474618189ccf330647574b4f062e2a0ec00a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eGZ z#W5tJ^=+6XUxNXUx4{4ZMKi1}aNqVl8q`1Ga3SB-HxJTxJP_{On6W&tXeP_!4^v~5 z3Js50PjFLU63q~16m4g4PO!L}^?$jedPkg7`SeE@+clKDHvMXMX|i(ZxT3>(MZjy_ zgaz9dsQ-UcZPl1_XN6+W!bMDL7_6Az_%?`Y9K2f_v9f5wlJ5te2wW_@8T{wmC9R7$ zY8tZ~`Ct7KO+<=iKZb&4sehr~3`*PU799{4sIws9u&$M${`VOF*89ZJ6T-G@yGywqhy;f}i diff --git a/Collector/Content/man/man-23.png b/Collector/Content/man/man-23.png deleted file mode 100644 index 2bc82ce8165a2290807d270f281a6f25b301da93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7ekj z#W5tJ^=+6VUxNZq@v;B)mGgWA61SBek$4&Cep_^g-svN!4HA3Ri!OFoJ=(;Xc5v>F zl%&)ycZIVJ)>0P~n6;KM9&`9!vii6DB(@LJ7R>al`Jzzt-FZ!&;>-nXf~NmJTKEAAUyyUuG}SJ5*q zU$9Lzopr E0KWiUcmMzZ diff --git a/Collector/Content/man/man-24.png b/Collector/Content/man/man-24.png deleted file mode 100644 index bcfe857f79a4da42bb3d52261e80fd43c2ae51ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eql z#W5tJ^=+6VUxNbA?VkVtKiOz>HeKGzv-iSm!Q1OLbe=eJKH!t}=|{;t6^}&JvmW@$ zJd1T?-p!p|yP|0K&XkVt3}y;NYp1QqpF$Peg@Y`AdA(Ox zPBjV^%sQ;T@KneQam$t{;rl8V*PJvlV7ct@ZLP#JXW9jjVH~-dbXEV?x;EN6}YVq}2sn#N^s0{a&Lbr+h$pdD0># zwQ3f9trNx#tQ|6&Q;q#OKOETM%y~mNwZEmzA(a2y?3>?gxAN4- z;1RH!SFQaY(>YnQ323+}-=vI9ChSaVtq0>9xpq++*Bg=(zr2 zSXSIJpYWDbAG%fuiuQHKIOQ_Wx45`gvQf%|O-bR8zhs<3s^ig+IYJF`j&B`yY*0{= Yzhi0TddkC&5$GufPgg&ebxsLQ0PRX>n*aa+ diff --git a/Collector/Content/man/man-26.png b/Collector/Content/man/man-26.png deleted file mode 100644 index bcfe857f79a4da42bb3d52261e80fd43c2ae51ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eql z#W5tJ^=+6VUxNbA?VkVtKiOz>HeKGzv-iSm!Q1OLbe=eJKH!t}=|{;t6^}&JvmW@$ zJd1T?-p!p|yP|0K&XkVt3}y;NYp1QqpF$Peg@Y`AdA(Ox zPBjV^%sQ;T@KneQam$t{;rl8V*PJvlV7ct@ZLP#JXWrOn}`; z{08f3_KCcHf4iS@%2>_kYEs%HzwCsh;0LvyU;nZvZ;*buS>f>nPsOno=q+a~t~xi_k%1#KAf_v);ewN#wp`f8s; g-=6OHIKP7N&T$)OgYKQdK(8@)y85}Sb4q9e0BT5X82|tP diff --git a/Collector/Content/man/man-28.png b/Collector/Content/man/man-28.png deleted file mode 100644 index 6dddff982a85a84f2688b9915e072a04b67028ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eql z#W5tJ_3gBae60#R&ex^?|DXQRvzhDqw!Rq>zcOx=nJp18{JJUO$dn^7MFHz~@GfMz zBf4EdEcN5EpmjP8TbVy@UL=*}$jiFIx@`A!#yfhK8M3Y#_#Y5qV6YHj{*duUaGBs= zOIGLF1pRxjcKygTe~DWM4frrB+n diff --git a/Collector/Content/man/man-29.png b/Collector/Content/man/man-29.png deleted file mode 100644 index 0c84de9203d356dd1ff08d65eeba985bdbd8b63f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D0te_ z#W5tJ^=+6V-(dre!%HOu= z)n}(z317U$-tm6MH|^d>iyu3x`IU!l5Szrx$$2$b!@jA6?a-Yz<74hqHJLq=$W?6BANrLh4<+bnXZSqLk4yg@1YAnu&AR66tQGb> zE4@OOqa$_0^??7ccn(+v^xNrXTss}ba97`&^YZqL$NzUQOcph;mXcns0`vrfr>mdK II;Vst0Nt@;H~;_u diff --git a/Collector/Content/man/man-30.png b/Collector/Content/man/man-30.png deleted file mode 100644 index 6dddff982a85a84f2688b9915e072a04b67028ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7eql z#W5tJ_3gBae60#R&ex^?|DXQRvzhDqw!Rq>zcOx=nJp18{JJUO$dn^7MFHz~@GfMz zBf4EdEcN5EpmjP8TbVy@UL=*}$jiFIx@`A!#yfhK8M3Y#_#Y5qV6YHj{*duUaGBs= zOIGLF1pRxjcKygTe~DWM4frrB+n diff --git a/Collector/Content/man/man-31.png b/Collector/Content/man/man-31.png deleted file mode 100644 index 53243c6ca0d7a9d4cb7e9221cd03823778405d30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D0s@# z#W5tJ^=+6VU$X&E_wv90Pv7m-bg<4@&SCgaIZMb|HBU({hDX9MH%ZSjBjk?SLKYd( z?H+rk9_Eg^UCg*fx?{TNRmc7-D_J%rh41w_5Ng@$;HDO=xJ-bdA=Hpz={NToZeNnQ z{Ju8kf1LN~OYA94Nx|alTAbe$LhmRl`X79;eD@vB*bDiLi!Z!ny36=YKET(rig$XT zv}UQy#arwh&u5&|j{Im=xLkO*vHJ$GNvr;+-$~~Y-t^~FQ^4D&(;DXFe-k|uKU40H at)0gtYnSPTxoSXPF?hQAxvXWIa+JYFs=g)DrQYvg zfc%Z_?Yq|P^R`q~PWl$rnjju@RF>nX$d|fZ*XLdktra(rwF+LKe&8STDoxMr56iAp z&9&;w*vsDWdd4~J$d8tV$wJdjXEHdOFdEH&8n*9E`c78Eueoda4_Mh&ur!tcJ;LDW L>gTe~DWM4f@iAg7 diff --git a/Collector/Content/man/man-5.png b/Collector/Content/man/man-5.png deleted file mode 100644 index 47e60f731612e06a358220b1a60f549e4fc75e6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D0te_ z#W5tJ^=+7=P>TXjcG;i*(?2e0=JKBOsN#Z*D-sHIIduJOOgRs z-o%J0r=`7i7BQ~jI&ywf)&kd8VN6?-!uR?d2(|2W=$+-$Hp2;M$w7uCm*f-q7TL!Z zyq3AqygelR`6T~L0mH3fo*TqhKH%fr$z9d|?xW|6rhnWLt$t!JcsAra$a-DM-?25y zf2FbD+S-O6eVO|&Y1mokr93K1XUSHSoG`&)H}6yT3FjPU+%7owV~vrkgYLmUQ(qi@ by^-n3S!bP0l+XkK!HIAh diff --git a/Collector/Content/man/man-6.png b/Collector/Content/man/man-6.png deleted file mode 100644 index 09a2a894b5a4a360742208687192a92273efed99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D7e?t z#W5tJ_3boAp;iSR=h^o6{-4@$$+0zG==6>WIa+JYFs=g)DrQYvg zfc%Z_?Yq|P^R`q~PWl$rnjju@RF>nX$d|fZ*XLdktra(rwF+LKe&8STDoxMr56iAp z&9&;w*vsDWdd4~J$d8tV$wJdjXEHdOFdEH&8n*9E`c78Eueoda4_Mh&ur!tcJ;LDW L>gTe~DWM4f@iAg7 diff --git a/Collector/Content/man/man-7.png b/Collector/Content/man/man-7.png deleted file mode 100644 index f68f4a890686bb4855e4d57ee3d76d0a3b0d72d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 283 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5D0tS> z#W5tJ^=;Tiz7_+H#n1lzpI+`Sm6z8i)^qZx-7H4k$wr&S`I()3w9mM*pY1xWGNU21 zu=7Z}<(|b`jl~^yG2ULXg3)bBp6Ub9)vq#{R-H0plAGt#CgIG$P}jxivGu->$)aw} z9aq`=9w}daXFYYY(V`Qvn^hLEJ0BGl`XX|sZrAa-0j?F|E+Sg79OVkX_%|$b$vs?q zCCy9Jeab!N#!{Jc-jRj#D=u_io+-M7-SgUi+Z%>D_mAhWSG~-1x*7M4HeKGzv-iSm!Q1OLbe=eJKH!t}=|{;t6^}&JvmW@$ zJd1T?-p!p|yP|0K&XkVt3}y;NYp1QqpF$Peg@Y`AdA(Ox zPBjV^%sQ;T@KneQam$t{;rl8V*PJvlV7ct@ZLP#JXW9jjVH~-dbXEV?x;EN6}YVq}2sn#N^s0{a&Lbr+h$pdD0># zwQ3f9trNx#tQ|6&Q;q#OKOETM%y~mNwZEmzA(a2y?3>?gxAN4- z;1RH!SFQaY(>YnQ323+}-=vI9ChSaVtq0>9xpq++*Bg=(zr2 zSXSIJpYWDbAG%fuiuQHKIOQ_Wx45`gvQf%|O-bR8zhs<3s^ig+IYJF`j&B`yY*0{= Yzhi0TddkC&5$GufPgg&ebxsLQ0PRX>n*aa+ diff --git a/Collector/Main.cs b/Collector/Main.cs index defa175..50601d5 100644 --- a/Collector/Main.cs +++ b/Collector/Main.cs @@ -1,4 +1,6 @@ -using Collector.Character; +using System; +using System.IO; +using Collector.Character; using Collector.Dimension; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -20,34 +22,35 @@ namespace Collector private WorldRenderer WorldRenderer { get; set; } public Main() - { + { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; IsMouseVisible = true; } protected override void Initialize() - {// TODO: Add your initialization logic here + { + // TODO: Add your initialization logic here base.Initialize(); BlockMaterials.Initialize(Content); var viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, 800, 480); - _player = new Player(0,0); + _player = new Player(0, 0); _cam = new OrthographicCamera(viewportAdapter); - _cam.LookAt(new Vector2(Player.X,Player.Y)); + _cam.LookAt(new Vector2(Player.X, Player.Y)); _spriteBatch = new SpriteBatch(GraphicsDevice); - _mouse = new Mouse(Content,_spriteBatch,_cam); - _inputController = new InputController(_player,_mouse,_cam,_spriteBatch,Content); - WorldRenderer = new WorldRenderer(_mouse,_inputController,_player,_spriteBatch,this,_cam); + _mouse = new Mouse(Content, _spriteBatch, _cam); + _inputController = new InputController(_player, _mouse, _cam, _spriteBatch, Content); + WorldRenderer = new WorldRenderer(_mouse, _inputController, _player, _spriteBatch, this, _cam); } protected override void Update(GameTime gameTime) - {// TODO: Add your update logic here/* + { + // TODO: Add your update logic here/* base.Update(gameTime); - _inputController.PlayerInput(this,_spriteBatch); - + World.LoadChunks(); World.UnloadChunks(); } @@ -59,7 +62,7 @@ namespace Collector GraphicsDevice.Clear(Color.CornflowerBlue); _spriteBatch.Begin(transformMatrix: transformMatrix); _mouse.Draw(); - WorldRenderer.Draw(); + WorldRenderer.Draw(gameTime); _spriteBatch.End(); } } diff --git a/Collector/src/Character/InputController.cs b/Collector/src/Character/InputController.cs index 243332d..fd1000f 100644 --- a/Collector/src/Character/InputController.cs +++ b/Collector/src/Character/InputController.cs @@ -9,35 +9,93 @@ using Microsoft.Xna.Framework.Input; using MonoGame.Extended; using Mouse = Collector.Character.Mouse; -public class InputController : IRestrictions { - +public class InputController : IRestrictions +{ private Player _player; private Mouse _mouse; private OrthographicCamera _cam; - private Dictionary animations; - public string Input { get; set; } - private SpriteBatch _spriteBatch; - private ContentManager _content; + private Dictionary _animations; + private string Input { get; set; } + private readonly SpriteBatch _spriteBatch; + private readonly Texture2D _texture; + private int frameNumber; + private int timeSinceLastFrame; - public InputController(Player player, Mouse mouse, OrthographicCamera cam, SpriteBatch spriteBatch, ContentManager contentManager) + + public InputController(Player player, Mouse mouse, OrthographicCamera cam, SpriteBatch spriteBatch, + ContentManager contentManager) { _player = player; _mouse = mouse; _cam = cam; _spriteBatch = spriteBatch; - _content = contentManager; + frameNumber = 0; + _texture = contentManager.Load("man"); Input = "Down"; - animations = new Dictionary + + _animations = new Dictionary { - ["Up"] = new Rectangle(0, 0, 32, 32), - ["Right"] = new Rectangle(0, 0, 32, 32), - ["Left"] = new Rectangle(0, 0, 32, 32), - ["Right"] = new Rectangle(0, 0, 32, 32) + ["Up"] = new Rectangle[4] + { + new Rectangle(32*0, 0, 32, 32), + new Rectangle(32*1, 0, 32, 32), + new Rectangle(32*2, 0, 32, 32), + new Rectangle(32*3, 0, 32, 32) + }, + ["Right"] = new Rectangle[4] + { + new Rectangle(32*0 + 32*4, 32, 32, 32), + new Rectangle(32*1 + 32*4, 32, 32, 32), + new Rectangle(32*2 + 32*4, 32, 32, 32), + new Rectangle(32*3 + 32*4, 32, 32, 32) + }, + ["UpRight"] = new Rectangle[4] + { + new Rectangle(32*0 + 32*4, 32*2, 32, 32), + new Rectangle(32*1 + 32*4, 32*2, 32, 32), + new Rectangle(32*2 + 32*4, 32*2, 32, 32), + new Rectangle(32*3 + 32*4, 32*2, 32, 32) + }, + ["DownRight"] = new Rectangle[4] + { + new Rectangle(32*0 + 32*4, 32*3, 32, 32), + new Rectangle(32*1 + 32*4, 32*3, 32, 32), + new Rectangle(32*2 + 32*4, 32*3, 32, 32), + new Rectangle(32*3 + 32*4, 32*3, 32, 32) + }, + ["Left"] = new Rectangle[4] + { + new Rectangle(32*0, 32, 32, 32), + new Rectangle(32*1, 32, 32, 32), + new Rectangle(32*2, 32, 32, 32), + new Rectangle(32*3, 32, 32, 32) + }, + ["UpLeft"] = new Rectangle[4] + { + new Rectangle(32*0, 32*2, 32, 32), + new Rectangle(32*1, 32*2, 32, 32), + new Rectangle(32*2, 32*2, 32, 32), + new Rectangle(32*3, 32*2, 32, 32) + }, + ["DownLeft"] = new Rectangle[4] + { + new Rectangle(32*0, 32, 32, 32), + new Rectangle(32*1, 32, 32, 32), + new Rectangle(32*2, 32, 32, 32), + new Rectangle(32*3, 32, 32, 32) + }, + ["Down"] = new Rectangle[4] + { + new Rectangle(32*0 + 32*4, 0, 32, 32), + new Rectangle(32*1 + 32*4, 0, 32, 32), + new Rectangle(32*2 + 32*4, 0, 32, 32), + new Rectangle(32*3 + 32*4, 0, 32, 32) + }, }; } - public void PlayerInput(Main main, SpriteBatch spriteBatch) + public void PlayerInput(Main main, Mouse mouse, GameTime gameTime) { var keyboardState = Keyboard.GetState(); const int movementSpeed = IRestrictions.MovementSpeed; @@ -45,135 +103,105 @@ public class InputController : IRestrictions { { Quit(main); } - if (keyboardState.IsKeyDown(Keys.W)) + + if (keyboardState.IsKeyUp(Keys.W) && keyboardState.IsKeyUp(Keys.A) && keyboardState.IsKeyUp(Keys.S) && keyboardState.IsKeyUp(Keys.D)) { - Input = "Up"; - Player.Y += -movementSpeed; - _cam.Move(new Vector2(0,-movementSpeed)); - } - if (keyboardState.IsKeyDown(Keys.A)) - { - Player.X += -movementSpeed; - _cam.Move(new Vector2(-movementSpeed,0)); - Input = "Left"; - } - if (keyboardState.IsKeyDown(Keys.S)) - { - Player.Y += movementSpeed; - _cam.Move(new Vector2(0,movementSpeed)); Input = "Down"; + frameNumber = 0; + _mouse.Draw(); } - if (keyboardState.IsKeyDown(Keys.D)) + if (keyboardState.IsKeyDown(Keys.W) && keyboardState.IsKeyDown(Keys.D)) { + updateAnimationFrame(gameTime); + Input = "UpRight"; + Player.Y += -movementSpeed; + Player.X += movementSpeed; + _cam.Move(new Vector2(movementSpeed, -movementSpeed)); + } + + else if (keyboardState.IsKeyDown(Keys.W) && keyboardState.IsKeyDown(Keys.A)) + { + updateAnimationFrame(gameTime); + Input = "UpLeft"; + Player.Y += -movementSpeed; + Player.X += -movementSpeed; + _cam.Move(new Vector2(-movementSpeed, -movementSpeed)); + } + + else if (keyboardState.IsKeyDown(Keys.S) && keyboardState.IsKeyDown(Keys.D)) + { + updateAnimationFrame(gameTime); + Input = "DownRight"; + Player.Y += movementSpeed; + Player.X += movementSpeed; + _cam.Move(new Vector2(movementSpeed, movementSpeed)); + } + else if (keyboardState.IsKeyDown(Keys.S) && keyboardState.IsKeyDown(Keys.A)) + { + updateAnimationFrame(gameTime); + Input = "DownLeft"; + Player.Y += movementSpeed; + Player.X += -movementSpeed; + _cam.Move(new Vector2(-movementSpeed, movementSpeed)); + } + else if (keyboardState.IsKeyDown(Keys.W)) + { + updateAnimationFrame(gameTime); + Input = "Up"; + Player.Y += -movementSpeed; + _cam.Move(new Vector2(0, -movementSpeed)); + } + else if (keyboardState.IsKeyDown(Keys.A)) + { + updateAnimationFrame(gameTime); + Player.X += -movementSpeed; + _cam.Move(new Vector2(-movementSpeed, 0)); + Input = "Left"; + } + else if (keyboardState.IsKeyDown(Keys.S)) + { + updateAnimationFrame(gameTime); + Player.Y += movementSpeed; + _cam.Move(new Vector2(0, movementSpeed)); + Input = "Down"; + } + else if (keyboardState.IsKeyDown(Keys.D)) + { + updateAnimationFrame(gameTime); Player.X += movementSpeed; _cam.Move(new Vector2(movementSpeed, 0)); Input = "Right"; } - if (keyboardState.IsKeyDown(Keys.Q)) { _cam.ZoomIn(0.01f); } - if (keyboardState.IsKeyDown(Keys.E)) { _cam.ZoomOut(0.01f); } + } + private void updateAnimationFrame(GameTime gameTime) + { + timeSinceLastFrame += gameTime.ElapsedGameTime.Milliseconds; + if (timeSinceLastFrame <= 99) return; + frameNumber++; + timeSinceLastFrame = 0; + if (frameNumber > 3) + { + frameNumber = 0; + } } private static void Quit(Game main) { main.Exit(); } - - /* - -public void handleInput() { - i++; - if (Gdx.input.isKeyPressed(Input.Keys.Q)) { - Main.cam.zoom += 5; - } - if (Gdx.input.isKeyPressed(Input.Keys.E)) { - Main.cam.zoom -= 5; - } - if ((Gdx.input.isButtonJustPressed(Input.Buttons.LEFT) || Gdx.input.isButtonJustPressed(Input.Buttons.RIGHT) )&& i > KEY_DELAY) { - Vector3 mousePos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0); - Main.cam.unproject(mousePos); - int x = mouse.getSelectedX(mousePos) >> TILE_SHIFT; - int y = mouse.getSelectedY(mousePos) >> TILE_SHIFT; - if(Gdx.input.isButtonJustPressed(Input.Buttons.LEFT)) { - i = 0; - Chunks.placeBlock(x, y, "wood"); - } - if (Gdx.input.isButtonJustPressed(Input.Buttons.RIGHT)) { - i = 0; - Chunks.removeBlock(x,y); - } - } - - if (Gdx.input.isKeyPressed(Input.Keys.W) && Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("UpLeft")); - Player.addX(-MOVEMENT_SPEED); - Player.addY(MOVEMENT_SPEED); - Main.cam.translate(-MOVEMENT_SPEED, MOVEMENT_SPEED); - } - else if (Gdx.input.isKeyPressed(Input.Keys.W) && Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("UpRight")); - Player.addX(MOVEMENT_SPEED); - Player.addY(MOVEMENT_SPEED); - Main.cam.translate(MOVEMENT_SPEED, MOVEMENT_SPEED); - } - else if (Gdx.input.isKeyPressed(Input.Keys.S) && Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("DownLeft")); - Player.addX(-MOVEMENT_SPEED); - Player.addY(-MOVEMENT_SPEED); - Main.cam.translate(-MOVEMENT_SPEED, -MOVEMENT_SPEED); - } - else if (Gdx.input.isKeyPressed(Input.Keys.S) && Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("DownRight")); - Player.addX(MOVEMENT_SPEED); - Player.addY(-MOVEMENT_SPEED); - - Main.cam.translate(MOVEMENT_SPEED, -MOVEMENT_SPEED); - } - else if (Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("Left")); - Player.addX(-MOVEMENT_SPEED); - Main.cam.translate(-MOVEMENT_SPEED, 0); - } - else if (Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("Right")); - Player.addX(MOVEMENT_SPEED); - Main.cam.translate(MOVEMENT_SPEED, 0); - } - else if (Gdx.input.isKeyPressed(Input.Keys.S) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("Down")); - Player.addY(-MOVEMENT_SPEED); - Main.cam.translate(0, -MOVEMENT_SPEED); - } - if (Gdx.input.isKeyPressed(Input.Keys.W) && i > KEY_DELAY) { - i = 0; - player.setAnimation(animations.get("Up")); - Player.addY(MOVEMENT_SPEED); - Main.cam.translate(0, MOVEMENT_SPEED); - } - Main.cam.update(); - - } - */ public void Draw() { - var texture = _content.Load("man/man-0"); - _spriteBatch.Draw(texture,new Vector2(Player.X,Player.Y),Color.White); + _spriteBatch.Draw(_texture, new Vector2(Player.X, Player.Y), _animations[Input][frameNumber], Color.White); } -} +} \ No newline at end of file diff --git a/Collector/src/Dimension/BlockMaterials.cs b/Collector/src/Dimension/BlockMaterials.cs index b38699e..08a93f8 100644 --- a/Collector/src/Dimension/BlockMaterials.cs +++ b/Collector/src/Dimension/BlockMaterials.cs @@ -5,12 +5,12 @@ using Microsoft.Xna.Framework.Graphics; namespace Collector.Dimension { - public class BlockMaterials { - public static Dictionary Materials = new Dictionary(); - public static Dictionary Textures = new Dictionary(); + public static class BlockMaterials { + public static readonly Dictionary Materials = new Dictionary(); + public static readonly Dictionary Textures = new Dictionary(); //Private so the singleton can't be instantiated - internal BlockMaterials() {} + static BlockMaterials() {} public static void Initialize(ContentManager content){ Materials.Add("grass",new Block("grass")); @@ -27,11 +27,6 @@ namespace Collector.Dimension { Textures.Add(name,content.Load(name)); } - - } - - public static void Draw(string name,SpriteBatch _spriteBatch,int x, int y) - { } } } diff --git a/Collector/src/Dimension/WorldRenderer.cs b/Collector/src/Dimension/WorldRenderer.cs index d16aab3..3aac292 100644 --- a/Collector/src/Dimension/WorldRenderer.cs +++ b/Collector/src/Dimension/WorldRenderer.cs @@ -15,8 +15,10 @@ namespace Collector.Dimension private SpriteBatch _spriteBatch; private Main _main; private OrthographicCamera _orthographicCamera; + private double _elapsedTime; - public WorldRenderer(Mouse mouse, InputController inputController, Player player, SpriteBatch spriteBatch, Main main, OrthographicCamera orthographicCamera) + public WorldRenderer(Mouse mouse, InputController inputController, Player player, SpriteBatch spriteBatch, + Main main, OrthographicCamera orthographicCamera) { _mouse = mouse; _inputController = inputController; @@ -24,6 +26,7 @@ namespace Collector.Dimension _spriteBatch = spriteBatch; _main = main; _orthographicCamera = orthographicCamera; + _elapsedTime = 0; } private static void DrawWorld(SpriteBatch batch, int layer) @@ -53,14 +56,13 @@ namespace Collector.Dimension } */ - public void Draw() + public void Draw(GameTime gameTime) { //Higher means draws in a lower layer DrawWorld(_spriteBatch, 0); _inputController.Draw(); + _inputController.PlayerInput(_main,_mouse,gameTime); DrawWorld(_spriteBatch, 1); - _mouse.Draw(); - _inputController.PlayerInput(_main,_spriteBatch); } } } \ No newline at end of file