From dbd635fa263f08023836abe268e59f2b85c7a58f Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Sat, 20 Aug 2022 21:32:36 -0400 Subject: [PATCH] stagework --- res/fg/rock2bottom.png | Bin 0 -> 4907 bytes res/fg/rock2top.png | Bin 0 -> 4911 bytes res/font.png | Bin 3819 -> 3830 bytes res/resources.res | 13 +++++++-- src/foreground.h | 49 +++++++++++++++++++------------ src/global.h | 8 +++--- src/stage.h | 64 +++++++++++++++++++++++++++++------------ 7 files changed, 91 insertions(+), 43 deletions(-) create mode 100644 res/fg/rock2bottom.png create mode 100644 res/fg/rock2top.png diff --git a/res/fg/rock2bottom.png b/res/fg/rock2bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..0fec024738d039b2f2910c066b2d4e1c0f4a05f5 GIT binary patch literal 4907 zcmb_f2{@Ep-@lQFWT_;IX;3P&8q5qsc0zfWN~JO@gIUZB!xT+PSz3_@B@xn-EmA0z zBwLF$JC%^iE?N3+ZQt{LU+?oh*L!_)UH6>rcYgon{LVS|9qzQvMovam1^@s#J6lU< zu!Jl;(h}gmWokqPSS<1|b2I~h+%vMXBuM~}v1eFVIPsiq%prDG76vGsfdLE+M*)Cs zc#?|;(PcoHFx5G3ZXYI!v1dE4l!iE)M~aAy6s0KO$}ttCEkj`$Wnn4Mqbpah@GX0x zcs3Ur5o(q@B^D^H^SWEdfY>SDsT!2uS8B+f%r2e8c_e*G3^D<%-E%B2hF%w=Ze2MV z251-?z|}VhBxHz?BNC!5aWL8N@iXE;_sq!f5IFi-d{K8Ta|-~lS{5De!Ok9bT2=K% z2GCjxT#GD!We%h&0BG(?v?PF*0ftif@#26s0PIy)TO}{@5(A8AQQIW||Cd@*;y|H} z%O>$HSAi|-t5$>q&zAwN7p|^|1ajN~ovL$TJh7Yvz&+|pO$^}v2@oZ1RHjNOr~vLM z3bHO@(vv{hSsSZiKw3{s=VVNFz{_23>*`zpU^tH&`8FzsD9KuPt9-57zB>WQSVM~& zPA$il92*e7BmIs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AdL3AmVEBnm3^Stnqnihzv{rY*_~gu&NR+9>+QdNCiD~`IC`2s%N#NK zAdu?hbqRvQrjgi7Gv{V=N2A}S7d|t)tg(%{&0%)AMBLcy$;Wf~(>)i5?fA2w52 zv7N+cZPeyi8+*GE_&!bw2HFfXb=M9zq0p~V0#fXM;T0AOqyz#&n*X?zHo=D}bQpr4BGLm><*0lG`y5$VXW zpm{QEgpx=1$V11z*0fl^n@VyC8 zvju|?S4Ss^1)EEQ7{XC73KEHg7~yaks=;|x=!myt@%SVbg=S|-fP${V84N0( zM!}NwNc#FPB!y0aVX!15j7%qEVESkbibSU14E3>?pYtu*6u*TvT$uk|&r~)AQGX_+MYG3&Q^EEd2JB-Js^93X>&CCN#{y)$m;@`Q?Bl-Wm^GG@tL!+X=S4*5835LPZ z=`fNZP9KIgpc;@sC4jjH^Zqx^8~l{)f9ClQYKkX`NNm+S0V8oBCpM{#{K;eij|0Cfr&CzozcKU zqv=b_Rmj}*7GDSu?R|8jK|>@aZlq_ucKn>AkxB4Tw(7S+)zVEH2iqMOOF}B6s$@wr`x#r`D_up%+TFX>V6B@WA*ma;HaX|ioZ_w1Qlg^u z3P9we4_b-}179^sqPt{@$2xWQ0mr04r=+UZ?Eo&R{o%#aM+|nZkGgYAaqT|R^xo$- zUR`wNB3IYS0Rv%Wt7esnulnY0>}oa5{iX5zX@$D!j*yhDN6U{FU$XE(?=ER{|EiG5 d9-flC@1B0>*v$Q?wuSrO&T5_67{{=L-8x;Tm literal 0 HcmV?d00001 diff --git a/res/fg/rock2top.png b/res/fg/rock2top.png new file mode 100644 index 0000000000000000000000000000000000000000..8cef8c172bcc8019cbdda2fbda3be93ecf545bf5 GIT binary patch literal 4911 zcmb_f2{@G9+kc1>$r2L9G$@rZi!sbFWbC25OfQ8p8wRtO8EauAWhs>{TcOBS*&;t*@4oNfxzF-M+3q$M7gZ1i06^T* z!o&_NA_~JGu@mgxrm6i~ykIl-L4E7yv}A=*GsjTsw0D#M0ClgT!JmFq9?|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GkbS z_rZTv54YDpBytX+dw%}RLdkgi+uVvLMj6Vxsk^Ng)~!gMSU6GZo3ni9q*&P506@?d z0N@`5fG=PZ{~ZAMA^>2-6##I_0I;5&e)A7~umfRhO*93|H6k)94p3V!0#sRF4;5-8 zFSCclV{TJpo9TNw<9Xh;k{C5Qit4b}IVi}tUjDK!IA%55VjmX(#MUi80zhiIJOHe$ zp%Wc>jyBdf3X7phqO!;|%>V`)L<4}nVE~&%@uKk{WSTpjiHClwx&wvKsd%V^whh9D zZA|l^TLf`v_CdRelprq(mI^gAfanL{KmrDhM}h<}yqR2F03P~{7YEjto8eH%Hwe!Q z4>ejg2ywKrg&4CqG>DES5=KEF5D*=#CY3}cQOINs2nvBh!VzdV5)DHja9UU#8V&jJ zgM#KbR5zTRiP;Zh;2R$5!Q-)UaJav}zox&ICX3?^M`E#9I06MnpNTvM3 zv3)t--;7f!aGE!bL1Xf`AQt%x3(90;^9%l4S_b16n#(iw13mf?+i%faVj!Cax1(`c zz8nh8)DN_%^3yT42aCtzda(XY9KX7MMZ?A!b7&+Ui$i3wynoJ=?N1g6N=p*~QMVyc z=*(r_ZOe9k4568jcr-i|oHrBg(6_!?mp-Ls{V+z5{He0ykr%Hz@#!B2*73s}1kvb~n-d@_ zij6MC)(maYavEYo9eJitsg+@h&6xet!_q=jucF(VJUt`TGN<>I-CJ})-w=?2#1d22 zsJn~^?|dq)zIywad$D=LopJ{FOE|US?Us3`z8sDoZF$(pK*aqK=hNO=WheRGe6Mj> zPK_hM%btcj(p^0rK9?o5OFgP9RVI8>gV26Cf>=wt9jO^uTOp_+B&cx3qM#lgTe1%r zv~l5|n@%hj7oR^p>4^;x~vJo?R&J lG@sctv;NP`E??J&)~^aIJ0WgnynF|+G~I1-mEd~hzW_?e7PbHY literal 0 HcmV?d00001 diff --git a/res/font.png b/res/font.png index b9f7c7c1da0e956c1d26986cbf9ed8f5fd858fd1..b78a4ff3f1f726d1e6340eda578cd4606dd6b2a6 100644 GIT binary patch delta 1787 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NpYI9X_PGMzf`SK% z9#Jwyw4RKU-+7KCZ?@%pR~x0%r4+_FZ+~>ADBs(yl%h{BG7#+D_s7hUS>k|sk`uG9 z+eVw6)=H*!_a|d}br-UbJ`is#5;+x?0+7+&5)pR zAVHO}`xWQDbrk_s!a+s%x^B6HOO-t?=(hKlhlhcQdep=CaGBgjCDmFD@ivzS)qmk@ zx`I>=j}O4qzAOYoZL(mrIN#(Fbw}!P09VhbND6DIM`DV2o$mII#eUK`nAlQ}bXkD8 z7!IT!re4M30EnSdI;;)xVQ7Xf_oREEaA-g5EwqdfAcP6`c}4k}7<9bLZUy#rz}a~KX<9NW`2lkv`Thoq2A z=XCsuFnKd01&uS>HN6)oNBZh2edZq#UVH*Hut+h$OTqJq8UHemSB?96d8 zLFK5VZg;1zYCRGh7YOx8eI~l%k3?*jDc{?zw5HEIBHB!h#~Y(2B#M*ho@B%9TRzZCv5AOP zGPPUzo)1KtETj*_8yj)+Q|9?dY6Yk@Ra{n@XFS!0)J%0I2e`E6V&Yq{6!VWaHctfOZ@m^?9a)xu;;=SN| z;=7J24 z6a 2){ fgPosXF[y] = fix16Sub(fgPosXF[y], FG_SPEED); if(fgPosXF[y] <= FG_LIMIT) fgPosXF[y] = 0; fgPosX[y] = fix16ToInt(fgPosXF[y]); - if(y == 3) fgPos = fgPosX[y]; } } + fgPos = fgPosX[3]; +} + +void nextFg(){ + VDP_clearTileMapRect(BG_B, 0, OBS_CEIL_Y + 4, FG_W, 17); + currentFg++; + drawFg(); } diff --git a/src/global.h b/src/global.h index 3d95b75..69b926f 100644 --- a/src/global.h +++ b/src/global.h @@ -37,10 +37,10 @@ Vect2D_f16 hPos, velPos; Vect2D_f16 hone(Vect2D_f16 pos, Vect2D_f16 target, fix16 speed, s16 lerp){ hPos.x = target.x; hPos.y = target.y; - // if(lerp > 0){ - // hPos.x = fix16Add(fix16Sub(hPos.x, FIX16(lerp)), FIX16(random() % (lerp * 2))); - // hPos.y = fix16Add(fix16Sub(hPos.y, FIX16(lerp)), FIX16(random() % (lerp * 2))); - // } + if(lerp > 0){ + hPos.x = fix16Add(fix16Sub(hPos.x, FIX16(lerp)), FIX16(random() % (lerp * 2))); + hPos.y = fix16Add(fix16Sub(hPos.y, FIX16(lerp)), FIX16(random() % (lerp * 2))); + } honeSpeed = fix32ToFix16(getApproximatedDistance( fix32Sub(fix16ToFix32(pos.x), fix16ToFix32(hPos.x)), fix32Sub(fix16ToFix32(pos.y), fix16ToFix32(hPos.y)))); diff --git a/src/stage.h b/src/stage.h index eab6cff..dfff2b1 100644 --- a/src/stage.h +++ b/src/stage.h @@ -3,12 +3,12 @@ #define SPAWN_MID 124 -// waves +// groups -static void waveOne(s16 off, bool big){ +static void groupOne(s16 off, bool firesAll){ struct enemySpawner spawner = { .angle = 512, - .speed = FIX16(0.8), + .speed = FIX16(1), .x = GAME_W + 20, .y = SPAWN_MID + off, .image = &fairy1, @@ -30,39 +30,65 @@ static void waveOne(s16 off, bool big){ .angle = 512, .speed = FIX16(1.5) }; - if(enemies[i].bools[1]){ - spawner.image = &bigRedBullet; - spawner.big = TRUE; - } spawner.vel = hone(enemies[i].pos, player.pos, spawner.speed, 0); spawnBullet(spawner, EMPTY); } } for(u8 j = 0; j < 3; j++){ - spawner.bools[0] = j == 2; - spawner.bools[1] = big ? TRUE : FALSE; + spawner.bools[0] = j == 2 || firesAll; spawnEnemy(spawner, updater, EMPTY); - spawner.x += 40; + spawner.x += 44; } } // loop -s16 stageClock; +s16 stageClock, + nextClock, + currentWave; static void updateWaves(){ - switch(stageClock){ - case 0: - for(s16 i = 0; i < 8; i++) - for(s16 j = 0; j < 2; j++) spawnObstacle(j == 0 ? TRUE : FALSE, 256 - 32 * i, i == 7 ? 2 : 1); - break; - // case 0: waveOne(-32, FALSE); break; - // case 180: waveOne(32, FALSE); break; - // case 360: waveOne(0, TRUE); break; + if(stageClock == nextClock){ + switch(currentWave){ + case 0: + for(s16 i = 0; i < 6; i++) + for(s16 j = 0; j < 2; j++) spawnObstacle(j == 0 ? TRUE : FALSE, 256 - i * 32, i == 5 ? 2 : 1); + groupOne(0, FALSE); + nextClock += 180; + break; + case 1: + for(s16 i = 0; i < 6; i++) + spawnObstacle(FALSE, 0 - i * 32, i == 0 ? 0 : (i == 5 ? 2 : 1)); + groupOne(-24, FALSE); + nextClock += 180; + break; + case 2: + for(s16 i = 0; i < 6; i++) + spawnObstacle(TRUE, 0 - i * 32, i == 0 ? 0 : (i == 5 ? 2 : 1)); + groupOne(24, FALSE); + nextClock += 180; + break; + case 3: + groupOne(0, FALSE); + nextClock += 180; + break; + case 4: + nextFg(); + break; + } + currentWave++; } } + + + + // case 0: groupOne(-32, FALSE); break; + // case 180: groupOne(32, FALSE); break; + // case 360: groupOne(0, TRUE); break; + + void updateStage(){ updateWaves(); stageClock++;