From 3c79087a69b2143056adb3cd8b1125c54f6dc502 Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Sun, 25 Sep 2022 21:11:37 -0400 Subject: [PATCH] explosions to blast processing, stage work --- res/explosions/blue1.png | Bin 0 -> 2161 bytes res/explosions2.png | Bin 0 -> 4761 bytes res/explosions3.png | Bin 0 -> 2129 bytes res/resources.res | 3 ++- src/enemies.h | 1 - src/explosions.h | 48 ++++++++++++++++++++++++++++++++------- src/main.c | 1 + src/stage.h | 37 +++++++++++++++++++++++++++++- src/structs.h | 3 ++- 9 files changed, 81 insertions(+), 12 deletions(-) create mode 100644 res/explosions/blue1.png create mode 100644 res/explosions2.png create mode 100644 res/explosions3.png diff --git a/res/explosions/blue1.png b/res/explosions/blue1.png new file mode 100644 index 0000000000000000000000000000000000000000..fce12cae1a7bff1ae26777069b9fc478a06f5bcc GIT binary patch literal 2161 zcmb_dPiW*+7?110b)|dpvZ#w`_TVn~lJ{O-l1aAHGM%aIK&O^=z!pJ#d3l)$ok`Lp z?Mw>_E-t#Rf_fAYWd%>_O@uv&AYQr`1z`_f^td4FNe~o$nLlZ_v};iZGI`1Sz2Eo! zzCZb{EicVaoO$ewBuNwXh1!a^%lUQsLGfSv_>FJHZE|_BIVbLSe){$0&8rr=eEx|i zug%WP0SB``uWeC24A=A5*r$Guh>>AS^3)Z+@l7fmc?ZGa9fFS9v>F*iHEA?oyNO zZZO+ZW~Sw-z9R^_Jfm{I+X+*rUseXZj#%ffHANmkvW>D*$qmYDjb*tSC0w>t1Q>)+ zwrtg-E@iI!w2UD}8YCJb076H%9YW;MPZ8!4&v#a8&y0+Tr?S${ve?nIUazP2bTvv^ z8nSI$gIL2D2n0xX!i@Gom|hq&)OgC0AkKm)lygSvMq61~5v~q3bmM|HOh<7N5!3oK z){qKwO#`6E3S7LEbOy#frtuE%@-RyU78TgI9c5A4j*g)&w(l_@V%umGHjebA+bv9_ z+1$2}F$&0$=(M>Lb8UsE(N@Cv+_rG@LaruustKoAlr*ELGtSiV*ku`G70DMxZXm*l zsIF=nw#;2fb#7de<%Qq8(TtasJfi?2fQ=@y90LMqI1mnTjmQi9odSme zvRFpzG z>bF_i8m&6P^wCaJ&v22)EPxqz0k;VT)MJJS0r4#i-4gOkQ(E3?fKp>mQsI)45!)Rhp%}U*17yC3yN2fAz1KFIVR$zx(0& z$=XME&Q-qOd-u(&r=-_kxO@Ja*QP(be*5vCCw{+vyBgwX^VZIdKTfI5SH8ZI&-wb? LQth+Z7q9#c=MJU7 literal 0 HcmV?d00001 diff --git a/res/explosions2.png b/res/explosions2.png new file mode 100644 index 0000000000000000000000000000000000000000..e8db9997092575c3832a3df6233a87f76aa82a43 GIT binary patch literal 4761 zcmb_f2{@E%-+xHfvb9*Uj44XYK9-p*iLqp75`~)OF{YTAX0sJailQu8vm7KsmO2!Y zb~%J3DV0ziN(e`Z@;)lQ?|Z*<&Udc&`sTWxx$ozBe*g9NyYG7@*2T$YrL?Lv001lP zY^~g&aT9b&N-l%Guf;hsp+Ssc;b;K>Ri|aB4if*#@&CSsG#phK2|% z5(5CXP1&hIWb%`>$J-l%Lh~M=Mct0QtiJ(th9&!wDCsJDH!YLJ;j6UrMHNU^nQ&W| zJCP4vHh5T7$*(3?N^Fqagi$7u_1V_lC(FyOeVUk<9V}yixcsShcBG+wmlBXvgi1>j zw--tHZPj>`N!GAJqAPy{h!oM-8>tI8cv#o%sSJ~pZ*F-IoukDS-6JM49_o2bl=G+q z7wIH1pL@=0_~7B8bU@+kWrB*nf>MmJwtWJ!ru{^^YMQ>EvbNv#O%@6*u>?xuO0!x0 zO9kmqFPPNC+$9uUc7IA8UGuTVLCfY&Oht?gt~N_wp--{O`UE;fZ@_4vhb)U*2CTLV zP~v#T!VMKLv6_mn;RA1gSGH1n4m{tf|B5biCyi@o-`>w#rMR50o{D_Y^(@ok(`$Mm zM@;lKpre=3%y{I}>Gmk&ni{ZnY|aZi@T`+Ws=-&+{EElpuwP4D<^_}N?azBjp(>wi z8S)qBPkyMF>r@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p@M>fkU=;ko6A692m}HOjYVOx2nd1Tg|PUPU<8Y|e$j&!$fI$Y96poHf-QKYP}u^$ zDI7}mM-73TCATcz&ptsNLj_YfC=3$4P}6rHowkJI2)F^?gVSj!FaQh$S$rOZ#Vlc= zHaR*j!T;24VBiv($0rG)jDFVkr)VBIgae}7KptDbrGX?N6mk7xVjO=qpUv}U|3w{3 zua~Of5G}bNh0o@a+3bKtrd$@iz_2(Z8n(%iLSwQP{OT^m`Dp@LQTU)K9O4a&KobyH z12V>lh%+J@Km_86X!H-LBP0bng-`k4U}GX0A{p~Pz-&6xFXaD((rH9LHaCz0^@$ls zVSp$Oi}5|0qa)Fd#p6?0G|hdn-0gu)yJ>Jsq;A(&+{m0^JA!{STod@Du|KWREjO(ETt57%B)FOPdf9@D*NF!$RC89{tewfU_7=TKZwEwEf`Q2|AC-Tf0aIuBK-U0 z@p!r)m5Mh&7~_o>xS`?^1T>b4Frt8TBSS+!44wim7XN3-;|+;eqec1sXUYF;EzO_8 zVt~+&iGu&<<@__1{uLMhwwnGw%Rw#dls|Na`gaNbmsl4CZvid71%dK@^16+}SYp_0 zVMYGa6=m{0ZU7Uq{yzKR2=(_7za#(KF286D9UTkPr9%t4SvvMW7Q`GEI@G)yWow}W zQDA3fK~{bQp0-fDftD2gC^;X&5qWTdxe9xLv>cBUy-}o!*}lUKMkk({i`x9vUhFZM0Fwg3PC literal 0 HcmV?d00001 diff --git a/res/explosions3.png b/res/explosions3.png new file mode 100644 index 0000000000000000000000000000000000000000..8b0fe99a6b6c9036ef27ad8d2b826d8e52e35b96 GIT binary patch literal 2129 zcmb_d&u`pB6n4vj(5e!G3qk~pduS^$_RM&^{?TlsWOr#+%7!RisfoB`JRa{_+4Z=# zlifsu0}_WGDmWs<0fZ0;2@nUk^uQ4${t1xa(hHoBI3O|h?mF8lDG{)ecg8c{eD8g4 z-t)V=xpDK-h379QigKyF*4&cg)ACtZctZYv|JggA$l>M9^=?a!4}Sjr%{y<~==$Od zFWp^T{$qLlulrZ-y{oV6{J8V!SJ%IN<6{YWDp}jf6y@Tx#dA)1|AXfg<;gFi?smT2 zS@)P2>NF5O*T=&|q7`Lnd7MzT$8*)^y(q40zuo^%Q=_1+-L^WglQeigT02Vlt)q=D zJKAGzpe^4}m&TqX81kH| zymcUDOapQvI_n-L+}Pro*iRX69Y{AX7ito(k#d@gv@675c2k=(msN~)q+XSG0})0< z_w}0Ps@#Xv= 3){ + VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, EXPLOSION_I), explosions[i].x, explosions[i].y); + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, EXPLOSION_I), explosions[i].x - 1, explosions[i].y); + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, EXPLOSION_I), explosions[i].x + 1, explosions[i].y); + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, EXPLOSION_I), explosions[i].x, explosions[i].y - 1); + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, EXPLOSION_I), explosions[i].x, explosions[i].y + 1); + } } +s16 explosionI; static void updateExplosion(s16 i){ if(explosions[i].clock >= EXPLOSION_TIME){ explosions[i].active = FALSE; - SPR_releaseSprite(explosions[i].image); + VDP_clearTileMapRect(BG_A, explosions[i].x, explosions[i].y, 1, 1); + } else { + if(explosions[i].clock > 0 && explosions[i].clock % 5 == 0){ + + explosionI = EXPLOSION_I + 1; + if(explosions[i].clock > 5) explosionI++; + if(explosions[i].clock > 10) explosionI++; + if(explosions[i].clock > 15) explosionI++; + + // if(e) + + // if(explosions[i].clock == 20) VDP_clearTileMapRect(BG_A, explosions[i].x, explosions[i].y, 1, 1); + VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, explosionI), explosions[i].x, explosions[i].y); + + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, explosionI), explosions[i].x - 1, explosions[i].y); + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, explosionI), explosions[i].x + 1, explosions[i].y); + + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, explosionI), explosions[i].x, explosions[i].y - 1); + // VDP_setTileMapXY(BG_A, TILE_ATTR_FULL(PAL1, 1, 0, 0, explosionI), explosions[i].x, explosions[i].y + 1); + + } } explosions[i].clock++; } +static void loadExplosions(){ + VDP_loadTileSet(explosion2.tileset, EXPLOSION_I, DMA); +} + void updateExplosions(){ for(s16 i = 0; i < EXPLOSION_COUNT; i++) if(explosions[i].active) updateExplosion(i); } \ No newline at end of file diff --git a/src/main.c b/src/main.c index 4b2b9c6..63cb9be 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ void loadGame(){ loadBg(); loadChrome(); loadPlayer(); + loadExplosions(); } static void updateGame(){ diff --git a/src/stage.h b/src/stage.h index bcb2a87..ae98812 100644 --- a/src/stage.h +++ b/src/stage.h @@ -800,6 +800,41 @@ static void waveBoss1(){ } } else { + if(enemies[i].clock % 120 == 0) enemies[i].ints[6] = 96 + random() % 64; + + // rays + if(enemies[i].clock % 240 < 180 && enemies[i].clock % 15 == 0){ + struct bulletSpawner spawner = { + .x = enemies[i].pos.x, + .y = enemies[i].pos.y, + .image = &hugeBullet, + .huge = TRUE, + .angle = enemies[i].ints[6], + .angle = 112 + random() % 32, + .speed = FIX16(3), + }; + for(u8 j = 0; j < 3; j++){ + spawnBullet(spawner, EMPTY); + spawner.angle += 128; + } + } + + // homing + if(enemies[i].clock % 8 == 4){ + struct bulletSpawner spawner = { + .x = enemies[i].pos.x, + .y = enemies[i].pos.y, + .speed = FIX16(2.5), + .angle = 256, + .image = &bigBullet, + .light = TRUE, + .big = TRUE, + .top = TRUE + }; + spawner.vel = hone(enemies[i].pos, player.pos, spawner.speed, 64); + spawnBullet(spawner, EMPTY); + } + } } else bossIntro(i); } @@ -812,7 +847,7 @@ static void waveBoss1(){ // loop -s16 currentWave = 18; +s16 currentWave = 17; void updateStage(){ if(enemyCount == 0){ diff --git a/src/structs.h b/src/structs.h index 6802ef8..d0efc63 100644 --- a/src/structs.h +++ b/src/structs.h @@ -75,11 +75,12 @@ struct enemy enemies[ENEMY_COUNT]; // explosion -#define EXPLOSION_COUNT 16 +#define EXPLOSION_COUNT 32 struct explosion { bool active; s16 clock; Sprite* image; + s16 x, y; }; struct explosion explosions[EXPLOSION_COUNT]; \ No newline at end of file