From 18e4b7a507d6b5debffc9fb06869a8b6d1b0c068 Mon Sep 17 00:00:00 2001 From: Paul Liverman Date: Sat, 10 Jan 2015 01:42:25 -0800 Subject: [PATCH] IT IS ALIVE --- run src.bat | 2 + source-images/fighter1/original.png | Bin 0 -> 334 bytes source-images/fighter1/redesign-alpha.png | Bin 0 -> 543 bytes source-images/fighter1/redesign.png | Bin 0 -> 355 bytes source-images/fighter1/redesign.xcf | Bin 0 -> 1976 bytes source-images/fighter1/shieldhit/original.png | Bin 0 -> 459 bytes .../shieldhit/redesign-transparent.png | Bin 0 -> 441 bytes .../shieldhit/redesign-transparent.xcf | Bin 0 -> 2417 bytes source-images/fighter1/shieldhit/redesign.png | Bin 0 -> 431 bytes source-images/fighter1/shieldhit/redesign.xcf | Bin 0 -> 2417 bytes .../shieldhit/redesign2-transparent.png | Bin 0 -> 479 bytes .../shieldhit/redesign2-transparent.xcf | Bin 0 -> 2630 bytes .../fighter1/shieldhit/redesign2.png | Bin 0 -> 450 bytes .../fighter1/shieldhit/redesign2.xcf | Bin 0 -> 2630 bytes src/conf.lua | 35 +++++ src/images/fighter1.png | Bin 0 -> 543 bytes src/images/shieldhit1.png | Bin 0 -> 450 bytes src/main.lua | 125 ++++++++++++++++++ 18 files changed, 162 insertions(+) create mode 100644 run src.bat create mode 100644 source-images/fighter1/original.png create mode 100644 source-images/fighter1/redesign-alpha.png create mode 100644 source-images/fighter1/redesign.png create mode 100644 source-images/fighter1/redesign.xcf create mode 100644 source-images/fighter1/shieldhit/original.png create mode 100644 source-images/fighter1/shieldhit/redesign-transparent.png create mode 100644 source-images/fighter1/shieldhit/redesign-transparent.xcf create mode 100644 source-images/fighter1/shieldhit/redesign.png create mode 100644 source-images/fighter1/shieldhit/redesign.xcf create mode 100644 source-images/fighter1/shieldhit/redesign2-transparent.png create mode 100644 source-images/fighter1/shieldhit/redesign2-transparent.xcf create mode 100644 source-images/fighter1/shieldhit/redesign2.png create mode 100644 source-images/fighter1/shieldhit/redesign2.xcf create mode 100644 src/conf.lua create mode 100644 src/images/fighter1.png create mode 100644 src/images/shieldhit1.png create mode 100644 src/main.lua diff --git a/run src.bat b/run src.bat new file mode 100644 index 0000000..f52efb1 --- /dev/null +++ b/run src.bat @@ -0,0 +1,2 @@ +@ECHO OFF +"C:\Program Files\LOVE\love.exe" "%cd%/src" diff --git a/source-images/fighter1/original.png b/source-images/fighter1/original.png new file mode 100644 index 0000000000000000000000000000000000000000..280c3ba6dea65ce4e308e75e72a1cf2abe3defef GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6P!2~2jos`;v6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(K&H|6fVg?4j!ywFfJby(BQ1G#*i(`m||I>+%LM;kBEPr?Qe@@J6=M3&> zh}-sULv4qrnxy0Q;*((~s}6Zx`&1}%F8$B+)BE1L?9`b5@r_d5t3&NCV#MaBJzeB- zpLO4Rqum>Rmqq&Y#a6t%kXj-0wK+#bBiFI7oBf^JluoYPP08FFRtW`^T3HJQ}ZYuZZ7G@6vfc9=Ufj@;CmJ1pv8JprSCiA z*_I{k6B1q+yq$5^OD9CH^`FuY{jB(je%1oqQ&)1QW-s|Om0O{Dk?pq6We2|K$?9~k cX`l0)okub1O0`*d1<<<;p00i_>zopr01)VeSO5S3 literal 0 HcmV?d00001 diff --git a/source-images/fighter1/redesign-alpha.png b/source-images/fighter1/redesign-alpha.png new file mode 100644 index 0000000000000000000000000000000000000000..457a612d3bb407fa3e7aeedb562176f5a3b708d5 GIT binary patch literal 543 zcmV+)0^t3LP)X1^@s6+90*i00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#NNd4#NS*Z>VGd000McNliru-vJ5*I5j$kcf9}r0jxC4 zgi@Mltzp^i?8qvW;#x7gogMLh6K_|&$IQ7#)A~fT)=_+oF^Mq<0%)xZeVKWYP-6_H z^@-RJeGJ z#3+kz~%0A_~gk86sVBZXDw zVK(R$>f*l441Zix%CqC*Gb+s%W`iEO)icohZ6xQ}#@k>i-4_`wt|!ov74_Cq z+F`4EgZ=Oc0Pu2fgikszBv0F-alP8D=#Oh^Ht3y1mxCj*^SG|k hY&qKkfZF7{X0ssI2RYD?%00004XF*Lt006O% z3;baP00009a7bBm000id000id0mpBsWB>pG1xZ9fR5(xNlEDqaFbqYz1VeQyuB^Zn zx=E*C1H=;LrQfw2rwu2>fiEkHf+@g;i+_B1MHF zHx5qeaRe%k+fyEiDju97a#B3e!9EFu!tx;NaY}l)uV~n$G*yw_$S4uyqWSuGDI64~ z#zN7Alq0LJ5`}6@G50oXyLBYUDyv9^&``9u+A30{_Ui7c;A$yRv9Y4)HzVDVmJ$uI z@sL95&01T7M@1nhyF>j7QIf$UQ&P|@rSmGr=?%)U1TaH~wpRcE002ovPDHLkV1k3P BkuU%N literal 0 HcmV?d00001 diff --git a/source-images/fighter1/redesign.xcf b/source-images/fighter1/redesign.xcf new file mode 100644 index 0000000000000000000000000000000000000000..ae44a0f070a846c08cba5e53da0b0568c905b494 GIT binary patch literal 1976 zcma)+&u-f|5XMQ`lH#;>|EfiS9(?E_JtRng<^_6L@G;!P)(S|RAWngHFLM?44SWrG z=~MK;r|=sDKIKq!QzI4k8;NpU)CEjnsBdOC8j?TDS$=xn|8z9!kMfhDz<3FJ#RB6A zOiE18U|a9M{&>R%{T$YYDcFmkd0mS2@9}(`;kCQ@=^z{KW*7M}LIQayb|#mfPlo-; z*-3uY;VbI^-+poqNaS&2(QTky`X_N2&S#as6$@$BE(BjWk~-n+wh zhlll2LP=7LVpc!<|4dV57b zSkVtxbazERg68)&BZ1(4JXU`ebwsF95Y6VXR{is9O#RD#$0+KUwr`mQ`NES)Oyt$Z zjzf(LHKp^?m+L%feiA2tIx;buDRWC6m1x(ym$5-{WNuxRVkuo@zN39%GXTIrewuAQR_Ctw;{)HJSY8bYtoxZ0G)OwN`xbVFlC zvxbJ2x~4IsE1Crw8Z>GjH1v&dP9Vp5mN;=0((q@5T_Tid{1|jeXtyA(h0xuKL&t)K z1q}-tsVAFQ(Ad~9IPhgw@@t6jsGfoctJ<}4+=6K-2eap literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/original.png b/source-images/fighter1/shieldhit/original.png new file mode 100644 index 0000000000000000000000000000000000000000..2e196d13af8744320441df2aa963662b86672521 GIT binary patch literal 459 zcmV;+0W|)JP)X1^@s6+90*i00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf00v@9M??Vs0RI60 zpuMM)00007bV*G`2j2k-1voW2hIhRH00BEmL_t(YOQn|U5rQxfgu$@|#|~`4YW%A; z`B$s41UvB2gO9~5ZjQSI^qXOF3Crek2@LJ?O;eyfUQ;yWxml(t0OlUe;nH1L Bz5oCK literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/redesign-transparent.png b/source-images/fighter1/shieldhit/redesign-transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..be113bd9ea45a1b9fe9af8736fe9d3df28ca5c6a GIT binary patch literal 441 zcmV;q0Y?6bP)X1^@s6+90*i00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#WTe4#WYKD-Ig~000McNliru-vJ5;3k~i!IY0ma0Y*tg zK~zY`wN^p0gD?mMrgw1X&AQbyxvTLu^%kz;CFE}!KS98BQD&G#CGq9)LW0Z;k>Rqt z0sQPR9L&t7L&^*(bLo3+>0AEr(B7gF$h~-KofzkJkgfiSNuQ>|qsVH#xZ>1A#j%ay zv$Fz%Z_Jt0Gx{chEhf?5BKLG2>HpsXo$4fceQzAW4~<%qsI`srISYAcL>peiq z46palLd{8wl^k4luFz3G!Lf}%{Zy^W8!M4ZR2pHlJIjhL{gfFY`@Vlg^I(Y)r zdSxDZ`TkKC9AKPR&~gLl?9H_RM@glNB0d2nVOlj>_h+n{*gc>xR5U(oNAGH(wH)c( jI}7mc-r|*qmc!)_7PP~(Hoy{a00000NkvXXu0mjf&TGPZ literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/redesign-transparent.xcf b/source-images/fighter1/shieldhit/redesign-transparent.xcf new file mode 100644 index 0000000000000000000000000000000000000000..f790dac387fa20e8e5d322688d984701df5fc51b GIT binary patch literal 2417 zcmZ{kU2YpU6opC7jAW;E+M;QT0)5a+0q4Pn4a6JBP87$Z3h*Cn7f8B~^?>02Pjym#A|SMQIHMwe&D)3-05 zZMT!dv*WXi(YAedE+%irqrKfdyPh!iyQ!C?zIh_GpCA3dq11Pm=i|fa>14Fu_X2$X z6xd-qzn@O8M$^;7-;OSof7Z5_M^_I7mHl6+AdgeE4};10h{+VL;ZBE|11jPLfaWVd1AvKkFoHl{9zurt?b<*!(F$_oB6ZLJ}(R4 zc7n)b`my3Y6N+T2y<%Y@vM+H3 z^bk^5Mjt!6$R!qHYD=@lAQwQ%f{*rzc{TMj+XIT@kf}W3>QPxwA8%~g0zfiJ!bIm~nsZ~|Az_k)B?|TA@j|aT zmFAML3pHroLsk$81kLn{K6Ff=wiiL%QglPrz5K>qspE|loC>COByI_k!LV%J5AMF$KYU<~< z2NcI4Q+dMG0}1Kr(~T{gd~dChuu!>MrVJf@Nc+P-Rq+Fd-rT+$~O%MgLdLoa>); z+FK?(<0BX50@EX0UKB_7nQ07llVtRN?cfR-|xM#R_dCL1F2K7%wM z%9C|CD zhmgV&Njti}un<$*1zSvTcK{^|KH4Yd)zr7P2NcJFzw(5uN9EL$--Ioje11p3jk_+C ZE!NgEbRSB=vawP~M}L){a|Um?e*iK`dlvuz literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/redesign.png b/source-images/fighter1/shieldhit/redesign.png new file mode 100644 index 0000000000000000000000000000000000000000..50e36d171fd9252e0ab0c51b7e43f0f7d7387577 GIT binary patch literal 431 zcmV;g0Z{&lP)X1^@s6+90*i00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#WTe4#WYKD-Ig~000McNliru-vJ5;2nQw4gPi~X0X#`W zK~zY`wN}Xy!Y~Y!J!yfV16rUOzED$mhH6p*RFI+xK$S|o4lcqV-Xd2`}$b5 zCAnQK-YLzXeorqk`r!ohVC*xr9VcwjL*y~wl_LTnKty&~FVzp-IxP$zn|UZLK2iD4-5#)gmzHI6_&eEx0O)$KZ4DeQd~9*f39 zjh->|_IbA@ocHZDCd4uD( ZE-!~GK~%k~bwdCE002ovPDHLkV1iifvH1W1 literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/redesign.xcf b/source-images/fighter1/shieldhit/redesign.xcf new file mode 100644 index 0000000000000000000000000000000000000000..51a9857dd0f7093033691378f3c90fff04fc1603 GIT binary patch literal 2417 zcmZ{lPi`AG6voMsMzYg7ZPBzvfiAQu;4Ey|KzxDRL~*3409i6D7f5=9-auRKdW&8| zHz2eMg2I($E9~!koKdCJ9S%9~eSClU*;F;Uy6(NZ9QKBz@xbx?!2D4H&o@l(S-xc+ zy#BNEvnKKjW}8_szprK4eTV&PzF${_JsDl~tHDWiGkOc;*!S*ucKd!j=*_0%(c72L zj)&FdbUeN39oy&Rrh3!wot>W9^Mr6-Z@t9z%@eN8e((PUxxSlS_b*42s(0Sx0(}1z zSYs!@PDZ!A(d6=%!A$aikXwn~_UQa67hzdO&rl?8GgIbouVJ-7`I%QdSyedT%f zh3ayBu0oaCDOfW_dH~2?)T47^UrGJk&Vb-3v?D*^%F(i%-mR={{Jo_v(}!HL*;+r{ z^f3pNv*saXs?_JH?G7NP6QD5MrI1Gug+UZ%fFgq^3}jx11p@&M3WF%jR!}I71qv5L zT8P5h)SyKJSwJWhun>hIVGo7D5Q&cp3Wc^~q7P8GulmJWc@)A2C}fxFa;zdip(&IL zOvy#KPawSTqxewB25*qOp|K)xE@1<-HOW;5AL??UP*tc>I|XY73IVbg_2`_~S5m*Q zGaxt$p7Il}98gG3A6C{j{@zkUVJ_Khtsf}N0p+X-g;pvQ2BR=SVZ2K*k0=TwO{_CO zkx>*zGOy#3fq({uQ50q?*ptQrUrQn_MPY4f(6WInAQTE%io%$%hr(!x#76~%LfbLX zM=0D^{c^253gIIZvP*S2RuQ4l6v_pr?>X&u~1V_PBe!`Ul3d!l?%G$=?TWToGC7Z4F1BE$Y zK3Fl-vQnWiLLoQQk@LET@Ero0I&x=rMX*C80+0t&Hb~eXqAF^0w zV^z8bU1HeOx3J{;5mnV;Qj%v5y7Yc literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/redesign2-transparent.png b/source-images/fighter1/shieldhit/redesign2-transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..56ddd448ff16bb9efbea3dae89e1db188535175c GIT binary patch literal 479 zcmV<50U-W~P)P000>X1^@s6#OZ}&00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#WTe4#WYKD-Ig~000McNliru-vJ5;6A%w7&AkkYpl#9UjNPxyyIC4qK% zA>~ei5UL#C+_y$cM(*3WL^z}c&unk@Psx2dgPIBVIf9zWZs5>rYxsf3dNG!Lh;1pz zQn0b?gB$nl^U6igx8T*N{w1_-3_H?dBW3hjL{6STUrez;&P0JsZ5zCi4!ft%%KP^Kn0~*)P`Yuh#6Z z*X*q|`x|WWcFzDq`Sh&+T@=IxD~?51J-*?Ox>>RCr`Cf!bX(cGo9uEK9AY!CT=x04 zgS^%QO(Ac%o{YYx-lL0wHZ_l6Q$p~33L0bo(X*fLEm=b;K7W?2pd}40sVtyIdAA|r zr_fqtADX_Rv+KcU1q2HBF66-Lv4gu)5=JO_1b2|tdS#0`OXv3wPr%(g)uIqe047%cm<7^`V9d@ zd1FHPR539v6Qx-y3#d^(p}gwsCWHp^3zUatAv&K>-WJrXa!@|eO4v~^aSTMY!-RB~ zK^b&k`B0t>1`WXp-(EubBzMK)g7OQh#>povOwn31WFi~{e(_*z_dq3*O4LVlS02Bx z{-`L+ZM9K~2nexq$*?T+`moXtozvOGL|QAJD3lk{@ykN_v{EUnoI*nRg!25~Z*j-n za5a>{g|S(#hT9IZTVhbIird__8r&LO9eqtb_r=pL6`LA&+ZtobFO6L?Oa%n5pb_`Y z)4;yFx15dpm<@0wYTQz{prx{a8l_7X&Zm%Xz55JH+Y;irANg%!LCq?s;ZE*xWwyjE zGwfWvc9@Xw94I4{e8GKUgF!=dJGV#>T$AOlSjf2WTaJPge*;#pXssE-gRbV*x4Peh zy9X+fR1)MRAMNP000>X1^@s6#OZ}&00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#WTe4#WYKD-Ig~000McNliru-vJ5;7&Oq`@Y(I z!CUF}@&y0@&!^-IAgUW`L#Pdj=6p$WS#3|2_n~)6B$nPZYT)|ZQKO|XRbQsaN?k;I z=Y$3j5z6DO9?bckp$rFCSr4oH8aZ0%Q7{nvL${(n8R;Xp7HScLZ%seLKdd}bXsa)- z&mBjAFh%($KxoalEpr+Jjxl$jHk5rpJSng7_)P1D9383|kONU`SmJXUYQqGzb)lx) z3(K0}a{qBhx&~d+`;yZ2%~sajfj}$1JF6rttw^l<=Ihe(QY61EzBMe9^(2yg sfagz>%07*qoM6N<$g83%B(EtDd literal 0 HcmV?d00001 diff --git a/source-images/fighter1/shieldhit/redesign2.xcf b/source-images/fighter1/shieldhit/redesign2.xcf new file mode 100644 index 0000000000000000000000000000000000000000..40715a8ee3a4a37c914079c1a63e9994a6f56491 GIT binary patch literal 2630 zcmZ{lPi|W`5XMRB$&%ALZPBzqfiAQu;4Ey|MSOwW#Ia>nfd9dAfdoB5Pw=+f^%lK` zZa`?2h0)rvEcW*e`C`>|6+XV<$C+=2^ErHz>DlGz{n5$jWO_Pw{C=p9>~DCyXZn_B z`1a3@pY&kA;%RsS&-c}q-*@=G<^A;p+MVgy;bgosxtbmWIrhEVo?U-99gk)gr_DrU2Ns8kns6ntG3(y|M;u@@;F3Ev7|&2Ei+6#C`KLu%GWOXOsVO24oU7 zc}ZVODhsGl-ff8ZDdbz9Kf%(rgm~A_H@2W=mDA+ldieo%4=wCIKiFY{yUU=AQ1XTR zHyaEZf)lyL`E z+*TWtdnYbKPR8{=HcSN8&fSI~&5-w;5QHzt&i z6%*4kQktc*fEwi^%B#+9LTDgAM|oK0qVo~uZ9&Z{2jwHJgdO!F$3Rp&Oo(?GltK5E z59Qfl&=8#P?M0N2a#t)aC_kraoP5N>6s=fDkK}49h~V7c1@1Ih{>Rq_yISLU|z_zburGE0wa!F+`M)rhG#AbdysqBPA)H z#MMDGH%a-Viqm4Dfyo*luvS3EG{U&plY0a!on1-HA5!CLEsk;#&!=>BB?}uGjpA1D z?zV%x)&os}8&(&G>uc&gx)^9v^9VL21kb0SG4>xl`|jS7HI(ArC)o;GQcg)_0X52V zTfzAhT8r#M(^s_aO7m;Dse7P-ci^p?`%Xz1q2v+VLHd&DtaZyu>e#HP+8xywoUU{J zILzi8PS2^&5~3gr3*YB-s7UE7udF3f@ZSco3yO+H%Pw=U$D I)H-zk0Aj#Uvj6}9 literal 0 HcmV?d00001 diff --git a/src/conf.lua b/src/conf.lua new file mode 100644 index 0000000..ad1c472 --- /dev/null +++ b/src/conf.lua @@ -0,0 +1,35 @@ +function love.conf(t) + t.identity = nil -- The name of the save directory (string) + --t.version = "0.9.0" -- The LÖVE version this game was made for (string) + t.console = true -- Attach a console (boolean, Windows only) + + t.window.title = "SpaceLove" -- The window title (string) + t.window.icon = nil -- Filepath to an image to use as the window's icon (string) + t.window.width = 1280 -- The window width (number) + t.window.height = 720 -- The window height (number) + t.window.borderless = false -- Remove all border visuals from the window (boolean) + t.window.resizable = false -- Let the window be user-resizable (boolean) + --t.window.minwidth = 1 -- Minimum window width if the window is resizable (number) + --t.window.minheight = 1 -- Minimum window height if the window is resizable (number) + t.window.fullscreen = false -- Enable fullscreen (boolean) + t.window.fullscreentype = "normal" -- Standard fullscreen or desktop fullscreen mode (string) + t.window.vsync = true -- Enable vertical sync (boolean) + t.window.fsaa = 0 -- The number of samples to use with multi-sampled antialiasing (number) + t.window.display = 1 -- Index of the monitor to show the window in (number) + t.window.highdpi = false -- Enable high-dpi mode for the window on a Retina display (boolean). Added in 0.9.1 + t.window.srgb = false -- Enable sRGB gamma correction when drawing to the screen (boolean). Added in 0.9.1 + + t.modules.audio = true -- Enable the audio module (boolean) + t.modules.event = true -- Enable the event module (boolean) + t.modules.graphics = true -- Enable the graphics module (boolean) + t.modules.image = true -- Enable the image module (boolean) + t.modules.joystick = true -- Enable the joystick module (boolean) + t.modules.keyboard = true -- Enable the keyboard module (boolean) + t.modules.math = true -- Enable the math module (boolean) + t.modules.mouse = true -- Enable the mouse module (boolean) + t.modules.physics = true -- Enable the physics module (boolean) + t.modules.sound = true -- Enable the sound module (boolean) + t.modules.system = true -- Enable the system module (boolean) + t.modules.timer = true -- Enable the timer module (boolean) + t.modules.window = true -- Enable the window module (boolean) +end diff --git a/src/images/fighter1.png b/src/images/fighter1.png new file mode 100644 index 0000000000000000000000000000000000000000..457a612d3bb407fa3e7aeedb562176f5a3b708d5 GIT binary patch literal 543 zcmV+)0^t3LP)X1^@s6+90*i00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#NNd4#NS*Z>VGd000McNliru-vJ5*I5j$kcf9}r0jxC4 zgi@Mltzp^i?8qvW;#x7gogMLh6K_|&$IQ7#)A~fT)=_+oF^Mq<0%)xZeVKWYP-6_H z^@-RJeGJ z#3+kz~%0A_~gk86sVBZXDw zVK(R$>f*l441Zix%CqC*Gb+s%W`iEO)icohZ6xQ}#@k>i-4_`wt|!ov74_Cq z+F`4EgZ=Oc0Pu2fgikszBv0F-alP8D=#Oh^Ht3y1mxCj*^SG|k hY&qKkfZF7{P000>X1^@s6#OZ}&00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY4#WTe4#WYKD-Ig~000McNliru-vJ5;7&Oq`@Y(I z!CUF}@&y0@&!^-IAgUW`L#Pdj=6p$WS#3|2_n~)6B$nPZYT)|ZQKO|XRbQsaN?k;I z=Y$3j5z6DO9?bckp$rFCSr4oH8aZ0%Q7{nvL${(n8R;Xp7HScLZ%seLKdd}bXsa)- z&mBjAFh%($KxoalEpr+Jjxl$jHk5rpJSng7_)P1D9383|kONU`SmJXUYQqGzb)lx) z3(K0}a{qBhx&~d+`;yZ2%~sajfj}$1JF6rttw^l<=Ihe(QY61EzBMe9^(2yg sfagz>%07*qoM6N<$g83%B(EtDd literal 0 HcmV?d00001 diff --git a/src/main.lua b/src/main.lua new file mode 100644 index 0000000..f186b6c --- /dev/null +++ b/src/main.lua @@ -0,0 +1,125 @@ +local Player = { + image = nil, + shieldhit = nil, + imgHalfWidth = nil, + imgHalfHeight = nil, + x = nil, + y = nil, + v = { + x = nil, y = nil, + }, + currentRotation = nil, + rotationSpeed = nil, + rotationImpulse = nil, + rotationDrag = nil, + rotationLowerLimit = nil, + degreeLock = nil, + forwardThrust = nil, + reverseThrust = nil, + sideThrust = nil, + maximumSpeed = nil, + accelerate = nil, +} + +function Player.accelerate(direction, amount, dt) + -- apply acceleration + Player.v.x = Player.v.x + amount * math.cos(direction) * dt + Player.v.y = Player.v.y + amount * math.sin(direction) * dt + + -- check if above maximum speed + local magnitude = math.sqrt(Player.v.x * Player.v.x + Player.v.y * Player.v.y) + if magnitude > Player.maximumSpeed then + Player.accelerate(math.tan(Player.v.y, Player.v.x) + math.pi, magnitude - Player.maximumSpeed, dt) + end +end + +function love.load() + --position and speed + Player.x = love.graphics.getWidth() / 2 + Player.y = love.graphics.getHeight() / 2 + Player.v.x = 0 + Player.v.y = 0 + Player.currentRotation = 0 + Player.rotationSpeed = 0 + + --image + Player.image = love.graphics.newImage("images/fighter1.png") + Player.imgHalfWidth = Player.image:getWidth() / 2 + Player.imgHalfHeight = Player.image:getHeight() / 2 + Player.imgScale = 1.5 + --shieldhit image + Player.shieldhit = love.graphics.newImage("images/shieldhit1.png") + Player.shieldHalfWidth = Player.shieldhit:getWidth() / 2 + Player.shieldHalfHeight = Player.shieldhit:getHeight() / 2 + Player.shieldScale = 1.6 + + --engine + Player.forwardThrust = 2600 + Player.reverseThrust = 1300 + Player.sideThrust = 800 + Player.spaceDrag = 0.95 + Player.speedLowerLimit = 20 + Player.maximumSpeed = 40000 + + --maneuverability + Player.rotationImpulse = 33 + Player.rotationDrag = 0.93 + Player.rotationLowerLimit = 0.5 + Player.degreeLock = 7.5 * math.pi / 180 +end + +function love.update(dt) + -- Player rotation input + if love.keyboard.isDown('q') or love.keyboard.isDown('a') then + Player.rotationSpeed = Player.rotationSpeed - Player.rotationImpulse * dt + elseif love.keyboard.isDown('e') or love.keyboard.isDown('d') then + Player.rotationSpeed = Player.rotationSpeed + Player.rotationImpulse * dt + end + + -- Player rotationSpeed adjustment + Player.rotationSpeed = Player.rotationSpeed * Player.rotationDrag + if Player.rotationSpeed < Player.rotationLowerLimit and Player.rotationSpeed > 0 then Player.rotationSpeed = 0 end + if Player.rotationSpeed > -Player.rotationLowerLimit and Player.rotationSpeed < 0 then Player.rotationSpeed = 0 end + + -- Player currentRotation applied + Player.currentRotation = Player.currentRotation + Player.rotationSpeed * dt + + -- Player movement input + if love.keyboard.isDown('w') then + Player.accelerate(Player.currentRotation - (Player.currentRotation % Player.degreeLock) - math.pi/2, Player.forwardThrust, dt) + elseif love.keyboard.isDown('s') then + Player.accelerate(Player.currentRotation - (Player.currentRotation % Player.degreeLock) + math.pi/2, Player.reverseThrust, dt) + end + if love.keyboard.isDown('j') then + Player.accelerate(Player.currentRotation - (Player.currentRotation % Player.degreeLock) - math.pi, Player.sideThrust, dt) + elseif love.keyboard.isDown('l') then + Player.accelerate(Player.currentRotation - (Player.currentRotation % Player.degreeLock), Player.sideThrust, dt) + end + + -- Player current speed adjustment + Player.v.x = Player.v.x * Player.spaceDrag + Player.v.y = Player.v.y * Player.spaceDrag + local speed = math.sqrt(Player.v.x * Player.v.x + Player.v.y * Player.v.y) + --Player.accelerate(math.tan(Player.v.y, Player.v.x) + math.pi, speed * Player.spaceDrag, dt) + --[[ + if Player.v.x < Player.speedLowerLimit and Player.v.x > 0 then Player.v.x = 0 end + if Player.v.x > -Player.speedLowerLimit and Player.v.x < 0 then Player.v.x = 0 end + if Player.v.y < Player.speedLowerLimit and Player.v.y > 0 then Player.v.y = 0 end + if Player.v.y > -Player.speedLowerLimit and Player.v.y < 0 then Player.v.y = 0 end + --]] + if speed < Player.speedLowerLimit then + Player.accelerate(math.tan(Player.v.y, Player.v.x) + math.pi, speed, dt) + end + + -- Player current speed applied + Player.x = Player.x + Player.v.x * dt + Player.y = Player.y + Player.v.y * dt + + -- emergency exit + if love.keyboard.isDown('escape') then love.event.quit() end +end + +function love.draw() + love.graphics.draw(Player.image, Player.x - Player.imgHalfWidth, Player.y - Player.imgHalfHeight, Player.currentRotation - (Player.currentRotation % Player.degreeLock), Player.imgScale, Player.imgScale, Player.imgHalfWidth, Player.imgHalfHeight) + --love.graphics.draw(Player.shieldhit, Player.x - Player.shieldHalfWidth, Player.y - Player.shieldHalfHeight, Player.currentRotation - (Player.currentRotation % Player.degreeLock), Player.shieldScale, Player.shieldScale, Player.shieldHalfWidth, Player.shieldHalfHeight) +end