From 98631cb721aabe7c907517938dcfba5c7186fdbb Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Tue, 16 Aug 2022 15:19:44 -0400 Subject: [PATCH] bullets are go --- res/bullets/bigblue.png | Bin 0 -> 3073 bytes res/bullets/biggreen.png | Bin 0 -> 3067 bytes res/bullets/bigpink.png | Bin 0 -> 3066 bytes res/bullets/bigred.png | Bin 0 -> 3075 bytes res/bullets/bigwhite.png | Bin 0 -> 2989 bytes res/bullets/bigyellow.png | Bin 0 -> 3070 bytes res/bullets/smallblue.png | Bin 0 -> 2866 bytes res/bullets/smallgreen.png | Bin 0 -> 2865 bytes res/bullets/smallpink.png | Bin 0 -> 2870 bytes res/bullets/smallred.png | Bin 0 -> 2866 bytes res/bullets/smallwhite.png | Bin 0 -> 2835 bytes res/bullets/smallyellow.png | Bin 0 -> 2869 bytes res/resources.res | 15 ++++- src/bullets.h | 124 ++++++++++++++++++++++++++++++++++++ src/global.h | 21 +++++- src/main.c | 2 + src/player.h | 39 +++++++++++- 17 files changed, 196 insertions(+), 5 deletions(-) create mode 100644 res/bullets/bigblue.png create mode 100644 res/bullets/biggreen.png create mode 100644 res/bullets/bigpink.png create mode 100644 res/bullets/bigred.png create mode 100644 res/bullets/bigwhite.png create mode 100644 res/bullets/bigyellow.png create mode 100644 res/bullets/smallblue.png create mode 100644 res/bullets/smallgreen.png create mode 100644 res/bullets/smallpink.png create mode 100644 res/bullets/smallred.png create mode 100644 res/bullets/smallwhite.png create mode 100644 res/bullets/smallyellow.png create mode 100644 src/bullets.h diff --git a/res/bullets/bigblue.png b/res/bullets/bigblue.png new file mode 100644 index 0000000000000000000000000000000000000000..013a853ec410fdab040e4c1843d97f5e8e67b311 GIT binary patch literal 3073 zcmb_edyHIF8J|i;T3A^iNMX}(ohGKOJ#)`F_uR+1>9pJKEZr^4vTirAXsn*sogF$e zcbu7hYLS$pl0d@4G*PO7XafOCg9J#iXygwq!KjHzeQZ%|lv0UGECl0&`rVn?>0-KL zL!9K!J@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<7?~WZ5~>!9(X%Xetn?8l3s|TB+Aksbw36b6duPdnO;4 zzki=~*#{qV#-e|njSrq2`_Z1%)l<=##cuDYdvdyn;vJkJ6|8^OCSB| z>Z2e2?1|g2yZ!WEo_l zu6gtN(TI;+x$51E?h}0Ep#J;FpB{Pj&!73>vG4!x#7AyDN~$NrXHT7&`|{bB=SS_y m>+hc5^IduJ?aDis{`1f``yP1Zr9H_(dw6gp_vF^k?fnnLO5s5O literal 0 HcmV?d00001 diff --git a/res/bullets/biggreen.png b/res/bullets/biggreen.png new file mode 100644 index 0000000000000000000000000000000000000000..1fb50a0f10f9c67d4e97bef4f02fb5fdd4441888 GIT binary patch literal 3067 zcmb_ee~27c9p9#vn#7Pm|FOpE++Hh9>)Uzn&6^)@$zF2Vz4VS`&&%aVu1K4_Uvsx) zcW0g1%l(LgRcxsmsx~0iv|2?hMXUtG{h2uG--_Pg!`}^L*Bg6NsS@p41nM`KQ&|qm4?wjFS_u(7i|C{{b^>D)@+s6jr ze(SnBw>~rQK)ZGSK)pLzP|I~V`9 z;_hlnwz4sJZ<5KZz9qeG$b9GUM>CmKn<``D&GGW~yozc$p(AN>GqnatXEGZ%%`}AC zXPTBY6P0=)`}bqVvsOhHvb)_fE;ov1vNAXqo1JsRV`^@n;ySyj&)PVX2ZEYu3TviT ztta`JLbk=5hjsee&RQ*z=DtF>1IpNe-tzwFDcJQ8P*= zqh-W9pWg@4szctGimNS)wX#js)J(mZfGp`KfY_GH9r0`0Qmb{OljgvFaHAcNYf2|$ zvkha9nk1Tvl^NI%8hcZ38u?;uL^F!VqNuuPMAH+1WVVsRvn!b%lBB%}9iv4#eU9^sycXpUqpt@2?M*963@QWF!#Zqz4Q=9bI( zp?cC3b!CQ1g)D?8SE=ZHsHI08!;w#fMhr`a0*4U9na{CNOgh|M#Frv9mF6?WFEoUX z6mVQMjypmV7l>TpX{3EdkyJQDKGhT(?qNp#MYhkx73fJ(UCNqTrGb%9E*+*EqyiTs z=7cVi4km~i5lC0Ku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Hq&$BR@9ILx?oL*(%! z=aCN;vt6+53XghBDqGFZd9&kNgs~Q9R%;&YEF?@Dn`OveeQ%p9MssWjLM7W###G51 z)-Xp}uM1b1L)XOkS^Vgb2BnKk=a!jT9MwlfRd)@-%({m8Z!P40O^ht=JckN#S8(Jq z34P&Fj(nSF7%IeuGIMMb*fUyQE#SNZXM@((^7)*f)vks_c~HXv$1*>EIM=o({C7B4 z-TeNa;WQhx)o0d!wqWzyyh9Kav-t{6R>`t`rh|v}sZf_8Q&l+g{bAzMY$~-R-J9zg z;75iZ*){Ttv1a*CGKZGF`>&ra8~^!ZE8e?*_tSU(w!8oDU);WOqWj@BX0&15mpA4H>@wel{zkl1ic|+%uBil}X@_26K-uv!Oj@rFFdvd3`_doD&s~ze6 literal 0 HcmV?d00001 diff --git a/res/bullets/bigwhite.png b/res/bullets/bigwhite.png new file mode 100644 index 0000000000000000000000000000000000000000..98d353a84e1409413ae3808410113b41bd381d8c GIT binary patch literal 2989 zcmb_eZ;V`36(5TUSS%DFM%tu29#LuK&b#-%``)|v+3B*KUFb@u-E1eajS#&5-tM?F z^Tv6zyR+qkRPaNSHdRSX!9`R02{90nKQ?@*f<|M~#6&|N8iVo$G!bH~Bqpfm&CE_0 z?T!s`GBfYJ`_AwD`<-*|IW~RZ&Mlj_Z7viFTc-9+%)s?__-(!F3i$tqIJO-wczS4Lq`r&^^pZFj61f++1-snLBn>W z({0q7S==qTJ-sp9=gXe!^h7!fC3ieG=*(88opRc?PE^E5V~m|h6pd6;D|MSgF(n>m z9$^UM*cUNl&fw#Mxwc8-nTb0F#^9;s&UZSk*z=Z`my64OF>TLzLQRb70%a@B zj_jglcFUTE37hG5t<|ZeO()kVRl3+Ix!`I)hDK|swwVp`1R3+XvgMH?&SUBcw&v4L zn$4#hh!0=C4`lREd26vK;^FIryHG7j-&za96MGSyPV#pG4F!1o2tK ztfoj>8zCF1KwIJaIPrITc^3hw-=OQ!$`~Ispdg9@#0az_7odl06(%xJR7RuFnh9p5 zL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E5?$7LuNg z5wk)Y2@4ZMHTQ(gZQHT^xbQD)US!z<{?#DowS~s&=MxL7Vxe!59@`disba`iwnj`# zin!J;(yp+j_ALvC)+RIVA^^1-bSYXWWdQ@SUDrm8Ks$Oq@OV-r|-T^H+_B1FX7EEwPLAMu|4D%S1zOQ_&!sXE%D&KbrpfM4E@hs$t zkRz&~09@C>A?aW_XF_mCD&%MZF}EBac{qg7*{)|h4iP@?kTJz1^Ms?2>%}n-eaM*Q zfNqDo)MY|ia%s$)72j$YvvX%bBf&fwD#V>Ov(O>i^;g@yVl>Bgz-7E0rIRwA!x}oj z^}29{IdoMWzkr{f)Ii!{I=9r+qOd;At9r`>%&e=J|K@V$*Z7{!#(R(<&*2_&n1H%) zsfT=vXc#KQf;4;BBCuz)tXjr+8_ou;t>uFmzrZdhd3i#^0mn>!aCfe5Pxxlk*S-Aw{LsbBs{I46ul>ij#PB;m z9lLNL%kLAfUV8l153le}-a2^v_ycEpAKZUtbmh>$Zk_OY&!02C*nMn%$BEPB7s)Gk z{d)cHhqsvCr;i?b?{NRyJr5qZ{*%rx`n^9smRk4v^S>E=>!s&T{Ihs|y1VxeUwLKt*tuus k|MJd5`R<4BIC}HFw|&27_OZ!3<5PBSU|aUb{ky*LZ{wlm?EnA( literal 0 HcmV?d00001 diff --git a/res/bullets/smallblue.png b/res/bullets/smallblue.png new file mode 100644 index 0000000000000000000000000000000000000000..6bfb0756c15a126eaa0343c88fdef8a89c97045f GIT binary patch literal 2866 zcmb_eO^6&t6dt2Oj06=u#6M^|K}@u!tE#KJy4pndx!5 zliiIsB?kqMUPObQ#2k!*2+@N<2*iMR5PuMV5IiUzL@)>O_w~%|WR=}9hyy)c-Tl7z z^S$?~-qSPFdp2&kV?(7<**LX#;vn1|xYn<~7XHsZy75K0;hBdUlW@QN=KFS^oqYL| zQ zQn~Tg^17z-{0o~Zl?^-7#%wWLe>m1zt13;VY<02K0qII*`_9FV)W>Y$C_9(7YwnNl zyz4rtskx5?bzJX^+xc|w$*w(ga=M{U9@E0OJ9jwS7h_P+vW0XOTg`SJFV@_i-Wb;9 zYtMChBE_+qJ60NWX6rM~c-FNJuVSPz#ts)%BbC%jJ>XDGiHDg-7{WOAMa-Bp__<)N zYm)fj#O{GHc&fScMbU{pZ((7fy5Lu{?wm)25FVx;r3fTYzSJ({B5LQGmo-e-TzAt> zk!EeD)F@SUyr{Y0YCncnXQ;NF4|oE`yhYjZNEMec^#nWfS&`-Q*&5=*&wm3MJyhN~ z-fi|gHrlgI+p_H<2U#*S0NmE=L-AF8X|;yZc`R9if&9mcOZ6{BF z#m!|jop`)!Ws!9oS=L<6)XZ{t4y9G*+*g-6ZI=OWT>-HZvamI`%p1Z1@=1fRn35P% zgjtMnU$hRTU}Paz3P%Ws4HCqD82f)0&P0Dp*UePbi2;>c$VF&z;kEU;{S8-|u+sR|iM1mcb&q^wmCNI*HIm`6sfjSh?= znnQ(JlR(C>44_QGeVQl{g~SAmlC{y1&y|XlMg%imat_I2SfeCKsNq@!A(11{TH?rp zG2+7x&M4T9%93FbV_FC!uu0ZNOBVQo6F_6402BErQi(*=Kml+b;)IOwTr#C(s0|9O z0?z$Vpa>^GUBIIt42cqWM8*u$EK;FCJSsU)1Z2z)!FDJ)22Gw)a7whb9K27TjLI1r>pEkSJm+Y{KC8ir6YFdzV$py ziUrxVV{@=)UB&+It>u0$PmFe+7y~E0G{_eWa!jKHs$4-z(-`yR zqvgLjKcGg>%l4dw0mpOydpK8jCiMMW8P2MQ-~Sm-uR!~C=KZq-d*4wUNUbm`J(cip}F4e`NU@w&HO{dCiTcV5XZ|9bbvJzq{g u_)LD(p1*L@+ov1pV_PnKyY1`WZ~FYUd+CQ{U!$B%rzWQ-UfXr_$-e;q0)nXk literal 0 HcmV?d00001 diff --git a/res/bullets/smallgreen.png b/res/bullets/smallgreen.png new file mode 100644 index 0000000000000000000000000000000000000000..d00ebc26c52c92c3bce6c347f4df059ac6b3113a GIT binary patch literal 2865 zcmb_eONbmr7#`niBqFFJieTHp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F<8FIjr$jYHMxbbjt|>&5+d-1iroZiZ?A literal 0 HcmV?d00001 diff --git a/res/bullets/smallred.png b/res/bullets/smallred.png new file mode 100644 index 0000000000000000000000000000000000000000..32d447ff6453d29e99846bb855fccd88c7bb998a GIT binary patch literal 2866 zcmb_eO^6&t6dr%T7>W1;qF!uUkQh_bRn^s9T}>t-*;$h%PFywvNf5#M>)jzU(_?pU zb~fTcMNmXRK@Xxr5IlG=1P>B~D1ydAz(XJyHK3@Vco0MnD*n8lnVqb%I|gx}r>nc) z_ul*7U)58y`*v^Icb@89$a-08j!z#u z_r&z}{t@%XQBX8GL7hrj#e*zN7TXYEJF-#Gd6Pv2jDce_+}b#Kq1 zyi&R5#`3zX^3uyUS1KEKw3-KtgN=J*op!3yq{>$NogPS6D%*DSdr}{^g`@0zt6Ot_ zc;{W$X_=aPAZXx5Z^|yT_8iUZ{-gVv`siUTjJspIv#lS4f{rbu)9A%usiM=1gclrMJ+*+<>{juj1co9nFA zD_UvSDK$!!E*3QxTpe=g^u}tt`6x~hF|RLs9;xDz(?GDdkQQmakgg*>{`@zP(PQPk z#jHK>*l5qTZO3+t9AwGZ0K~S@7>lpzOQ$oI&Wq_IKw}h;HKp_Ba?g5mHcuBbZKscb z#XCwiy?83KvPiRLnzmOmHM>I3p|r}J%?+tr-IDNKt01;63tMx`ydfMQpEL=JDTy&f zn8g?mMH^5GMiz3laD;H!Bth(lF$w-AoSIg${I8@)KDT?9Gc!FE5)p=oR*CBv9Vcnlkr1<1N6uTX*PS1@+i1iy-Mo-pZD;B=7s69* zwM-l&m_~^fNC*`mhJ`^n{EL=XwCn_aIpjPaHP$XUKU%e0+gH@%z$cs$g^3Ilm3$IfGr_Es$cPeMt|ShD8YfgnN=VAW z^=;FD=|EG4lvWZkKTt^0L?FtEAJQa{9MkpDjQYk#P{onY7-BjiNLYxn^=%khj-@7S z0@@d$uQfqD@daWg0xwh&AQ@O9p;b7MW&&COfM9|oPZHoAMMznzfJi_&rI<%Xt&a|j zBARoItVtkaSO!Q$;66>1h(cllM#=i<$mdE$N+W`yA|d9GEQU2ol7t$rMGz7>0j(vD zEEpp`OmIfQc2t%OlsD5t7^wAReY9kOFF5o7a4%aT@=>G`iKu}B;5@_$nc%r(O36?g z6j}u__d|gqoIvOT9tB}Yl)w`*W|(G?3Ju~>8S_Ly#{3X$hmupyl=k)Nm=7v`*f8GY z&Kh>`o>tju%cBn2Zyy@>iZdA7vDD>uRC9GXhpll(uUl))p-bub5q@dGg3<}od1yUP zlVV9`cIQ0ItV@{x-g@rm^2lW8i7~L#OM`sDAjdFJp~@Ac+`tCGjZc)~E9BR7p2nE3 z>=ysc`B7-}g6z&)IN*5hf2VV4d&1Dq)pXX}{Qgfmg907anfK2U9DG}K2!dn|Uct$# zT#nCl@Gw3V+Ac&YgEQZu4{j?@j1SDzcQ$W+q4P1h_6oA$%J@T3XhPwa& literal 0 HcmV?d00001 diff --git a/res/bullets/smallwhite.png b/res/bullets/smallwhite.png new file mode 100644 index 0000000000000000000000000000000000000000..63e9ee779fea6b670bb6eb2048ada261871bfa93 GIT binary patch literal 2835 zcmbVOO=uid9A6c&jRXo_sv?ZjgDv&#y!YnKym>=6F-_7Yv>VfQp)Fo~Uz04|-P!I; zl1;oR^#c)41ra~!)k6zjq$miU6ugK~gbL!pkK#cO)q|k;pWV$iEy)_XFgqXb|NH&F z|L?uAxNv-Y?1`~bsWd)6H**^94qSWoJOuyOUKoELZg}xzZ5Hm2?>l(x+U%7Zmu4rr ztLEQV$e|Cu`1SiUCw_cu{l@i|Zhd#<>Bfm~?U&a+y8h?w-yS^ND9HA<=gw!P(xZlWoc4n%iU%hq)VkElijw|7i{h*yHsyg+}}U_+;!@v z;+_qvxZ0k!%k{a9jyD0I$M7oF*}V;x>5NMnp0F3LtKsg-)xp_md6GmkKYaqNqjF=y~|L0!ir@#&dk z17+}5ahLPF9edu|+FE(dFQ=U)j|d?=Og%~wNT6)JmCG(_Wd}AHW^ATA^>$uQTTa0! zRl1T_TrjooL$f`kZDoTvLBzbSY1aE<3K|a--n8TC zj+J@ZsikRSGgFJ3?m3i}nRBozb-h(Md}s^A&dA(W+#+uX2goNi!eUBdOc7==#(mK$ zl!B4D916o~hzO}s8sjJ?{4U|t)RXo96&;2*o=zKSr<$6=4%fN!eSUg+v6CkC1}tQ! zj~{jBXQx9V!Vu9iaUG-MB<(aM#H`+wOV(?*mU`w^tMPm*%VkU3`I(9f;VIYaCJvzJ zt(F>vK@cIv0*RDX9I1%QgiD|LKCt$37SE)5rO0Q2?>B@=HE`T9&JSs%sUpZKE|BC* zqlg-Tl0;D75}KGW*kpUYQ-_|EjjgPORi>~i3MJ+?M3@E^F-{{S5`hsWK`3ORc*1y5 z_;)mKvP^-08RR@0G}ckMG#zFp+_xl8-`bCYY5H8Bw5%Cy7IFjT0&(B_w6x&bn#9 zbf76Kk|YuH1BE0_1frZk?2|xpOm{{z>KhwD6-Pc}i0OzRVIj)aw_#{GmYT2;XkUcB z)&%jy7l@e%tWZgSWMGMeR^ddN5oiGbf(cYbl7Qb)gp{=k90@3=6!XZaoza0&M01Xj zH3?)4%K(W8%%_PGQAkX{DA^eu`CO?;X+$toB*Yw&#ju95OsL^n1R;?l&|2cif->U6 z1ZNaV*YzOnV-qk(Z&;FV5gS``GP@?X_P>f!xSV2HVAHfq7>hBep};V!x-)s_h*Y|&t5xq_Ubo_Pks3JA3rVnwO_ve_>+r|yt*-Y^T|WcJbY{Xo!fqK P^qikvn7MlN#h3pByr^|p literal 0 HcmV?d00001 diff --git a/res/bullets/smallyellow.png b/res/bullets/smallyellow.png new file mode 100644 index 0000000000000000000000000000000000000000..1e8731b0035c3dfdf43dd59d47f4ca3a7f573242 GIT binary patch literal 2869 zcmb_eONugU1|Nw{6B7_?x~jUmtE@orI%k_Un;HH-k3g|AFl0)(RG};ySr+40S zorbBnj|Vke>x|iYW8zfT9z3;gTAwkoUbGFXKprB=Q>CCm7?JS-0qOV-=1#?}K z#0RRo2FBp2;@0!L6MNq5>}+|~FQ?rZj|d?=Og%~wNT6)Koy$4Y&NeP+sM<_-8=bt7 zww*$wROyMl;sVva53SBnZ95yp2_ojr$&N?LxbUeb*r}&^n$^=~#D|~%0y282ymO-4 z>@halvrXHw?K}fnGBg0Ot<{F&OLA$ohSFI+eiGam1Y}9+Yj*U%q)1=Xa z57~j;JDth#v5<%`M6^s?$LKgoyDbSZYqaEy^*ZgD9^G0ko@{5iY->ANt+)`La-(5l zqQXE^su1xNMT|*-q)!D3c@X&|h*V(M0=}B+6Gc7?e7_+~szJw1a#7-24p77*ArQw* zAw{A9B}8Ez24O(Le(-?JW8DVyq--wMTCg&pF^EEmxeXDffklkd2#G{sgh>zznJAtx zUKIXK%L`g|fPWd}JR3CDPB}AJH5=O&)Z@S>oEnCNDb!m{k+ha0%T=JQ@O_;4TfL%- z0Mu{L#b{-W4;oOw3r`8OV`j z_%Oj41=~?kGAv?D3t;7ikK$?GUkV1JCvMqrnIjY$GlhZ{f6;IcNR1f zbnrx@=(PDkha9xWhrQzT#&#@qu^m-hUCd!?+`;R{5_9O5I(~qkty@q!VmkM&XK9kp z%C6lp12gLu=D)Wb{Y;)5O`aG7JH0f>7clV{jS{GG1t~YML2%;}rTBvLOOmHC<_o*U zzau{gjjqe~jD-V^=l%zGZfQ^G^IYuClAGWE=}xae`*r61y##yT79D~hnY~wVvMQFt zGaWn(PldJ(k?O*kZ}!Qv#o6@8WOc{%`g5(%$eI=VSFL>i_^; -1 && (spawner.player || (player.invincibleClock < INVINCIBLE_LIMIT))){ + bullets[i].active = TRUE; + bullets[i].pos.x = spawner.x; + bullets[i].pos.y = spawner.y; + bullets[i].dist = fix16ToFix32(spawner.big ? BULLET_DIST_BIG : BULLET_DIST); + bullets[i].speed = spawner.speed; + bullets[i].angle = spawner.angle; + bullets[i].player = spawner.player; + bullets[i].clock = 0; + bullets[i].dead = FALSE; + bullets[i].big = spawner.big; + for(u8 j = 0; j < COUNT_INT; j++){ + bullets[i].bools[j] = spawner.bools[j]; + bullets[i].ints[j] = spawner.ints[j]; + bullets[i].fixes[j] = spawner.fixes[j]; + } + if(spawner.vel.x && spawner.vel.y){ + bullets[i].vel.x = spawner.vel.x; + bullets[i].vel.y = spawner.vel.y; + if(bullets[i].vel.x > 0 && !bullets[i].player) bullets[i].vel.x = -bullets[i].vel.x; + } else { + bullets[i].vel.x = fix16Mul(cosFix16(spawner.angle), spawner.speed); + bullets[i].vel.y = fix16Mul(sinFix16(spawner.angle), spawner.speed); + } + bullets[i].updater = updater; + bullets[i].image = SPR_addSprite(spawner.image, + fix16ToInt(fix16Sub(bullets[i].pos.x, spawner.big ? BULLET_OFF_BIG : BULLET_OFF)), + fix16ToInt(fix16Sub(bullets[i].pos.y,spawner.big ? BULLET_OFF_BIG : BULLET_OFF)), + TILE_ATTR(PAL1, 0, 0, 0)); + // SPR_setDepth(bullets[i].image, 4); + } +} + +static void killBullet(s16 i){ + bullets[i].active = FALSE; + SPR_releaseSprite(bullets[i].image); + if(bullets[i].dead){ + // spawnExplosion(bullets[i].pos.x, bullets[i].pos.y, 0); + bullets[i].dead = FALSE; + } +} + +void updateBulletVel(s16 i){ + bullets[i].vel.x = fix16Mul(cosFix16(bullets[i].angle), bullets[i].speed); + bullets[i].vel.y = fix16Mul(sinFix16(bullets[i].angle), bullets[i].speed); +} + + +// collision + +#define BULLET_LIMIT FIX16(-BULLET_OFF) +#define BULLET_LIMIT_W FIX16(GAME_W + BULLET_OFF) +#define BULLET_LIMIT_H FIX16(GAME_H + BULLET_OFF) + +#define BULLET_LIMIT_BIG FIX16(-BULLET_OFF_BIG) +#define BULLET_LIMIT_W_BIG FIX16(GAME_W + BULLET_OFF_BIG) +#define BULLET_LIMIT_H_BIG FIX16(GAME_H + BULLET_OFF_BIG) + +static void collideBullet(s16 i){ + if(bullets[i].pos.x < (bullets[i].big ? BULLET_LIMIT_BIG : BULLET_LIMIT) || + bullets[i].pos.x > (bullets[i].big ? BULLET_LIMIT_W_BIG : BULLET_LIMIT_W) || + bullets[i].pos.y < (bullets[i].big ? BULLET_LIMIT_BIG : BULLET_LIMIT) || + bullets[i].pos.y > (bullets[i].big ? BULLET_LIMIT_H_BIG : BULLET_LIMIT_H)){ + killBullet(i); + } +} + + +// loop + +static void updateBullet(s16 i){ + bullets[i].pos.x = fix16Add(bullets[i].pos.x, bullets[i].vel.x); + bullets[i].pos.y = fix16Add(bullets[i].pos.y, bullets[i].vel.y); + bullets[i].updater(i); + collideBullet(i); + SPR_setPosition( + bullets[i].image, + fix16ToInt(fix16Sub(bullets[i].pos.x, bullets[i].big ? BULLET_OFF_BIG : BULLET_OFF)), + fix16ToInt(fix16Sub(bullets[i].pos.y, bullets[i].big ? BULLET_OFF_BIG : BULLET_OFF))); + bullets[i].clock++; +} + +void updateBullets(){ + if(killBullets){ + for(s16 i = 0; i < BULLET_COUNT; i++) if(bullets[i].active){ + if(i % 4 == 0) bullets[i].dead = TRUE; + killBullet(i); + } + killBullets = FALSE; + } else { + for(s16 i = 0; i < BULLET_COUNT; i++) if(bullets[i].active) updateBullet(i); + } +} \ No newline at end of file diff --git a/src/global.h b/src/global.h index e7fe089..2ec5d97 100644 --- a/src/global.h +++ b/src/global.h @@ -19,8 +19,27 @@ #define GAME_Y 0 #define CLOCK_LIMIT 32000 +#define COUNT_INT 8 + +bool killBullets; s16 clock; u32 score, - highScore; \ No newline at end of file + highScore; + +void EMPTY(s16 i){} + + +// structs + +struct bulletSpawner { + fix16 x, y, speed; + Vect2D_f16 vel; + s16 angle; + Sprite* image; + bool big, player; + bool bools[COUNT_INT]; + s16 ints[COUNT_INT]; + fix16 fixes[COUNT_INT]; +}; \ No newline at end of file diff --git a/src/main.c b/src/main.c index 4e65260..f77ef09 100644 --- a/src/main.c +++ b/src/main.c @@ -7,6 +7,7 @@ #include "controls.h" #include "background.h" #include "player.h" +#include "bullets.h" #include "chrome.h" // game loop @@ -30,6 +31,7 @@ static void loadGame(){ static void updateGame(){ updatePlayer(); + updateBullets(); updateBg(); updateChrome(); clock++; diff --git a/src/player.h b/src/player.h index ba16521..dffd0d6 100644 --- a/src/player.h +++ b/src/player.h @@ -4,10 +4,13 @@ #define PLAYER_INIT_X FIX16(40) #define PLAYER_INIT_Y FIX16(GAME_H / 2) +#define INVINCIBLE_LIMIT 60 * 4 +#define SHOT_INTERVAL 15 + struct playerStruct { Vect2D_f16 pos, vel; Sprite* image; - s16 clock; + s16 clock, invincibleClock, shotClock; }; struct playerStruct player; @@ -17,6 +20,7 @@ struct playerStruct player; static void spawnPlayer(){ player.pos.x = PLAYER_INIT_X; player.pos.y = PLAYER_INIT_Y; + player.shotClock = SHOT_INTERVAL; player.image = SPR_addSprite(&nitori, fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)), fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)), @@ -40,8 +44,8 @@ static void checkPlayerBounds(){ // movement -#define PLAYER_SPEED FIX16(2.25) -#define PLAYER_SPEED_NORM FIX16(2.25 * 0.707) +#define PLAYER_SPEED FIX16(2.5) +#define PLAYER_SPEED_NORM FIX16(2.5 * 0.707) s16 playerFrame; @@ -74,6 +78,34 @@ static void movePlayer(){ } +// shooting + +// shoot + +#define PLAYER_BULLET_SPEED FIX16(16) +#define PLAYER_BULLET_ANGLE 0 + +static void spawnPlayerBullet(){ + struct bulletSpawner spawner = { + .x = player.pos.x, + .y = player.pos.y, + .image = &smallWhiteBullet, + .speed = PLAYER_BULLET_SPEED, + .angle = PLAYER_BULLET_ANGLE, + .player = TRUE + }; + spawnBullet(spawner, EMPTY); +} + + +static void shotPlayer(){ + if(player.shotClock >= SHOT_INTERVAL && ctrl.a) player.shotClock = 0; + if(player.shotClock == 0) spawnPlayerBullet(); + player.shotClock++; + if(player.shotClock >= CLOCK_LIMIT) player.shotClock = SHOT_INTERVAL; +} + + // loop void loadPlayer(){ @@ -82,6 +114,7 @@ void loadPlayer(){ void updatePlayer(){ movePlayer(); + shotPlayer(); SPR_setPosition(player.image, fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)), fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)));