From 2d178455cda5dc486b981ba8dba28ab3ee882222 Mon Sep 17 00:00:00 2001 From: Dangrain Date: Tue, 21 Jan 2025 22:12:43 +0100 Subject: [PATCH] Add files via upload --- main.lua | 74 ++++++++++++++++++++++++++++++++++++++++++ sprites/explosive.png | Bin 0 -> 2249 bytes sprites/fiberwire.png | Bin 0 -> 1289 bytes sprites/knife.png | Bin 0 -> 2036 bytes sprites/pistol.png | Bin 0 -> 1225 bytes sprites/syringe.png | Bin 0 -> 1669 bytes 6 files changed, 74 insertions(+) create mode 100644 main.lua create mode 100644 sprites/explosive.png create mode 100644 sprites/fiberwire.png create mode 100644 sprites/knife.png create mode 100644 sprites/pistol.png create mode 100644 sprites/syringe.png diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..579f1ad --- /dev/null +++ b/main.lua @@ -0,0 +1,74 @@ +local inventory = { + {name = "Pistol", sprite = "sprites/pistol.png", descip = "Long range enchanced pacifier!"}, + {name = "Knife", sprite = "sprites/knife.png", descip = "For cutting that bread"}, + {name = "Fiber Wire", sprite = "sprites/fiberwire.png", descip = "Enhanced pacifier"}, + {name = "Syringe", sprite = "sprites/syringe.png", descip = "Poisoned syringe, hell yeah!"}, + {name = "Explosive", sprite = "sprites/explosive.png", descip = "Goes boom boom and boom!"} +} + +local currentIndex = 1 +local rotateAngle = 0 +local targetAngle = 0 +local rotationSpeed = math.pi / 2 +local centerX, centerY +local radius = 150 +local sprites = {} + +function love.load() + love.graphics.setFont(love.graphics.newFont(24)) + centerX = love.graphics.getWidth() / 2 + centerY = love.graphics.getHeight() / 2 + + for _, item in ipairs(inventory) do + sprites[item.name] = love.graphics.newImage(item.sprite) + end +end + +function smoothRotation(dt) + if math.abs(targetAngle - rotateAngle) > 0.01 then + local delta = targetAngle - rotateAngle + rotateAngle = rotateAngle + math.min(math.abs(delta), rotationSpeed * dt) * math.sign(delta) + else + rotateAngle = targetAngle + end +end +-- thank fuck for chatGPT being a thing for these formulas otherwise I'd never have figured It out +-- I'll leave It on github.. + +function love.update(dt) + smoothRotation(dt) +end + +function love.keypressed(key) + if key == "right" then + currentIndex = (currentIndex % #inventory) + 1 + targetAngle = targetAngle - (2 * math.pi / #inventory) + elseif key == "left" then + currentIndex = (currentIndex - 2) % #inventory + 1 + targetAngle = targetAngle + (2 * math.pi / #inventory) + end +end + +function love.draw() + love.graphics.print("Current Item: " .. inventory[currentIndex].name, centerX - 100, centerY + 200) + love.graphics.print(inventory[currentIndex].descip, centerX - 150, centerY + 250) + + for i, item in ipairs(inventory) do + local angle = (i - 1) * (2 * math.pi / #inventory) + rotateAngle + local x = centerX + math.cos(angle) * radius + local y = centerY + math.sin(angle) * radius + local sprite = sprites[item.name] + + if i == currentIndex then + love.graphics.setColor(1, 0.5, 0) + love.graphics.draw(sprite, x - sprite:getWidth() / 2, y - sprite:getHeight() / 2, 0, 1.2, 1.2) + else + love.graphics.setColor(1, 1, 1) + love.graphics.draw(sprite, x - sprite:getWidth() / 2, y - sprite:getHeight() / 2) + end + end +end + +function math.sign(x) + return x > 0 and 1 or x < 0 and -1 or 0 +end diff --git a/sprites/explosive.png b/sprites/explosive.png new file mode 100644 index 0000000000000000000000000000000000000000..03a11d974e5ab5e03179a9934e1983a4fb1ce6b2 GIT binary patch literal 2249 zcmZ{lc`zGl7sg|&&|XVXJFx||#lDu>V~@3BD?u$Si6p39wWuw(lu*}NRbz{NjZjM| zEpBP;w568R7E!fz>PzR&+?j8_`R2@f&b-f=-*eu7-Z^P7Tk}6y1y}(9z#kS+69-xa z{XW1;w2X<4{{H*o3w5vo0HVPFK;k0+;EX0EZUF${5CGttHvphh008i!in{IfXpKt< zD{~XT#qTI1RXwFC%vcK>Q)V(9H@mXrUP}EtnqqEYV(8>LxQmC^6+82%l(x+n>?PQ3 z?vP?EN2W^_j3AQ9^uy(NdNcoEI`t%V0c}3|l|bdC!bd>~hUAztL1y-L-0scWjQJERC;GF&>Zi0QadRbx z(;@+YJ z4HxMhu|&z+Y8(4}qLQcauXl9`Wxr}|cA`#Myh`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3s&hwASkg;ZymSv3qzku zJ#S3i&!3U4q_1)?H0AVHOZ{OW-8!??VP`1?f*0@{S>~N;`F?tEONN;ZzYpRbvS+u@ z7m%2+nZ8FoIatfY;o=(^W)lv~z>`Jb$wTFv3+>`f@(xVH+1xmjOKb}rG9DREipbcs z4=u2g3~p}==yax$pwc+i%wSw59RXq9>)l?wH;*n~I^U8AI6jY~_S_US%{DG)8U{8m zfjFRIAUR52*7p4uW(YBv{9L?g=L___VqWlJuS#G&Gebd9;d;}E2zxZ?K8Yjg`ID2- z#EPECmyk;j>BN3TU9gB{TZ%J+80%e*0=vjNO0xpy`kL(rWUghV8G@%SU*dZvhxC-~ zr~vXnnf%rf*R^I~@j8$Ze_#4W$Q8nMm|}s)7t7=)tP)FVqaj@8XLiKfaiqSe&ZIT1 zhjbst*o+>husM!P#ME=Enn4naa~2_Tg(j%CYKN9lNV91bEdOciy?vT&smXk!qcZ-6uvuR8)-ccgOMsFc{U? zvz)j5qJ3!>+kI{c3=b)GLd)KB_Ovalg*A1>8Y4qO{6nz-+D-@gB10qm(O7>!P-GA` z5EO{TqA)s2O8(ISL3b2=ks(Tv{s@!;7O8*=4REj9eM9q*`t9N8gZ0<(Mf=kVKn0?r zt^iS1P=PoptLvy~>nLl>K_EI1$a|iN@&5uskbXgTqW(Wn28{@#0W$wizy^i*W3WCU usQ+bDHU1f53<2rTn5(}TN8}xBqz~F3@bCM}23uTdU4VtDtqH-%JLy0Ek{I;> literal 0 HcmV?d00001 diff --git a/sprites/fiberwire.png b/sprites/fiberwire.png new file mode 100644 index 0000000000000000000000000000000000000000..c1c06593bf122b6c9844d734162dbfd0b52bcf05 GIT binary patch literal 1289 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=k0Y$sR$z3=CCj3=9n|3=F@3LJcn% z7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG?e4&pI;QH0-6%q;(K_OrOb+#W-l z7fCj&3*MdzwW;}|vNn0io)e`p(@uPnnR||n?Qio@ra9Grc{@0Sp5ICRYtP_LD5&T-`0#<~`&ui#bc zwz#|?&2RP`{<@0?j&8s2xWd-t*k*$q?`ajiACC*XDmC`*@aW)h5#hmW>>N#S&Mx9Cvvhd8bzX%X5jtdq1We3Vj;?wY0V^Qj392 zX9ughGmp#bgCC@PzH&)vue)gRb89cF!UUooMrN5t3GE8 zlf}iXt#dkMwoH$TtdB5a=+N2G#t_ig*73~Lb5rhRj--;a8&A;ySc?&nhkG`eIWr+wR`V|_bMT<(bd z48~4x8NqI0@iRP1#kyN99ad{hc>XglP-M1xxOvcle=G<4&ZT#FGcy!8vp-{#m=^1D zctV6+%dTH0Znn?o+!lL2W5!8KPKF14+zF{qQyUok?ryI$(@wOCijLi@d#JC&!{t>q zJNt3=54W$0F)Ub@_VCNgVDtO`AACxWoMtCHamtL=$U}$k#(K<><7Z%ab7yz|ra2D| zzEie%?%=||NoW7$)SEsokLtE}f6kB1VY%QF$#8z&ztSz893pFzxUqzE+4=D+K#rfJ(YUV~8+{j4f@e zqAu4KE9oDo>zOmz(m zb&U){3{9;}EUgSJwG9lc3=A%co;!=8AvZrIGp!Q0h6NsFg+L7&a2rZ8b5n~;5_1bM Z^%$E$EO9naumb8~@O1TaS?83{1ONm?CUgJ* literal 0 HcmV?d00001 diff --git a/sprites/knife.png b/sprites/knife.png new file mode 100644 index 0000000000000000000000000000000000000000..e02effca39ecb75015b3d98b0404184ff2e56da7 GIT binary patch literal 2036 zcmZ{lcTm%b632fOrRh;bK#BrEED%XT({P6*1VgBo5b4rFXc7Sv2mz&dfO>!^RU|?r zaEbzU z_jH`hCMC%0BGCc*gGX}n%|2h6KQl>nh-XNVvS7d1ZR_y+zHNM<^~Fx@rMdp-kd4T0 zOK)37`g*=WT(&$t((UMC4*MvopmN*iOiF_$XJF`sEWWE{v;MNFI~I*C>@#7b5}^B3JhFrR2z88up#!(_(ddl?;=NMZolKdeiT)@P2W>7omg<*!!JKeliZ8k9RyTN`9GJ2sQIHO$F7j$6 z#%h8>L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Jl&rza-IY6kEQZ9{ze- zf@x)SGg)wVp*z!|bY+bOdEgrHDQA{dRJSwy4#Z0k2LgKUJ7BR|cL;oO|B~$TAA+Ue zu*-A9JdNQiPkLo3W<;ZQ9EuF zcoZEaVC>>k4NGQLS%6;c^?a#(e5SPy5@D2y(Z#Ku=YqZ%9IGot93NX*Gsl(rxVCqs zEJkl%_BvT|sqa~jf6XJ5w!HWQ7m3nW-^O9z;5_r_B(p0Gw@sr2#QC~1D(Hi1$?1B} zrA5T4aPwn@=H0y{k4`>0?Id_!V2RGiOKNULFpP06h9CF!@;Op2Vm=4fzs}|G;bPko zXHrhhzR{YH(_O~qzCACJd4D&*|Kj5m;Ws-@v2vyO`%;K-!d0SB02l;j42D3#FbE!M z3^zIlhe7lp5I6+VC7QPTUjQl0KRAH)|ACj@MhGEr@;@6W!6YJ?;!6tuU&hen-%BhZ xns6a=9+{b>=M#GkJjz*sq;Dv>@n{soFXwDSM} literal 0 HcmV?d00001 diff --git a/sprites/pistol.png b/sprites/pistol.png new file mode 100644 index 0000000000000000000000000000000000000000..f2e128218926f300cc2b1c3a8e56c36560325aba GIT binary patch literal 1225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE0wix1Z>k4zl0AZa85pWm85kOx85n;42huMY z7)lKo7+xhXFj&oCU=Yur6o1qWsFo?o+ueoXe|!I#{XiaPfk$L91B0G22s2hJwJ!q- zvX^-Jy0X7y6yY~idDph~3tbe@@0rwc!#!tWaIr;`+wGc`mg?+LvG3JNj48l;vyt{c;@ddJ-)dk zAm*ve`~d5u@;wa|PPH%W9-Eb|G5fpnKgaPaTRxxn|95%L5}z*Bwtw;#?KKDg95i5M z63D6kDQX(|zxsK^_mHg$i#TSpscir8D&YaovCTavS{geYI}NKgtXRHw&Mfo1*Mapm zJ3o~@%zi8Qcq_YZv3Q5#VGnO5rfZD?-EJ~wlXo`mYP?cu78Z7Y&(9~mh0UdWOfolu zW?$+Q*s{S@$hF0NqR?xPiCJ|kW;Vvh>&I-^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