From bceaab2878572a6e2561bc5c4fc471fb450d60af Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Mon, 15 Aug 2022 20:50:22 -0400 Subject: [PATCH] she movin --- bible.txt | 73 +++++++++++++++++++++++++++-------------- res/bg/1_1.png | Bin 5062 -> 5484 bytes res/player/nitori.png | Bin 0 -> 4506 bytes res/player/player.png | Bin 2142 -> 0 bytes res/player/reimu.png | Bin 0 -> 5350 bytes res/resources.res | 2 +- src/background.h | 16 +++++---- src/main.c | 4 ++- src/player.h | 74 +++++++++++++++++++++++++++++++++++++----- 9 files changed, 128 insertions(+), 41 deletions(-) create mode 100644 res/player/nitori.png delete mode 100644 res/player/player.png create mode 100644 res/player/reimu.png diff --git a/bible.txt b/bible.txt index 615e1c1..49601fc 100644 --- a/bible.txt +++ b/bible.txt @@ -1,32 +1,57 @@ -########## -# THEMES # -########## - - +######### +# THEME # +######### + + - 100 (overheat) + - connect/transfer (???) + ############ # GAMEPLAY # ############ - - The player controls a ship which automatically flies forward through scrolling levels. - - It has a limited amount of fuel that constantly depletes. - - Fuel is replenished by destroying enemies + + - scrolling shmup either horizontal, isometric-ish, vertical depending on zone + - nitori will overheat if she doesn't kill (like fuel in vanguard) + - bomb + - single straight shot + ########## # LEVELS # ########## - - Tunnel 1 - - Mountain Zone - - Rainbow Zone - - Styx Zone - - Rainbow Zone 2 - - Stripe Zone - - Rainbow Zone 3 - - Bleak Zone - - Last Zone - - Tunnel 2 - - Mountain Zone - - Stripe Zone - - Styx Zone - - Rainbow Zone - - Bleak Zone - - Last Zone - - At the end of each tunnel the player must defeat a boss guarded by two moving force fields with holes in them. \ No newline at end of file + + - level 1 + - hori + - iso up + - hori + - iso down + - hori + - iso up + - tate + - boss + - level 2 + - hori + - hori + - hori + - iso up + - tate + - boss + - hopefully about 8 minutes by here. now we start looping with suicide bullets + - win screen or kill screen at lvl 255? !??!?!!!?! + + +############### +# ASSET NEEDS # +############### + + - tate sprite for nitori.... + - think connect/transfer + - bigger shot and robot sprite? + - 2 songs min needed + - start + - stage + - extra songs ordered by priority + - boss 1 + - boss 2 + - stage 2 + - game over screen \ No newline at end of file diff --git a/res/bg/1_1.png b/res/bg/1_1.png index 7ecb2c65e26dfd004307c2c7d1961b01a22feda8..40de2b037062d8e9c6fb1d35d599db6ee6f48b61 100644 GIT binary patch delta 1247 zcmX@6{zhv9J2w;C&dr?MJxn|nx`w79Mg~@f=2nK27xK!Z3Y_7!R53R&w@gYjOV%~F zNKMu?u`n>wwMb30&`mK-F}6&yOiMLQHrTAmw~TSJ0KX`6abnqIEq*!IwB*!8OS4o{ zT}u-)LtPWYq$D6K#ZuSYz{1ipH7(KHG$~0*p}54gti-B3BQ?)f$;iOSNY?=D9-w1P zjI9ieCin8&2}2bnXC&sOr>58{=_~0^=H-`w+eD1}aM}d*xgp3VK@6KFpW=_J-(Guu z5d#Brm#2$kNJMLGc=V>%3OvG!ul`++K6~N!Lv@ws&lc+*k%*qgD$D#e;4OP<^0jI~ zfp6(O1_Bvs3=QkgzMpI+Jp0D=x$9OwuiDHNzA7*>?yR5aI|c?%0fqZp*@HS`ZqNB7 z$~a-)Qr=&iK9xStYFd=jyMou&_@c1WN51-gu?)3}gnTs?<+&!SMFdi(tmnA=&Rh2| zGc(hX>?x)XIcF8m=jXBU*~+_mLZf{xhY@Fz%c)f9^sFV1mdv=hF=)a0EPn-U_lcH5 zHCvJy1f{EPJAchsqrmoa>N7v7mnseWeYZPpnW+$S@QcsP{G|=$D;6(((m2V3bLNS- z=PU08JCysw6H$$GX1!>YkOlksr(S2+5)T{@O6QZe)6 zUeQD0mXS&Q+&-EQ+5Ru%m*u(6E+6~h+vKu0uE_=L8RaPx@4VExwbE6fYNAyE zyX}9;W}K2(rRC{n(d!?Y_IZkiX2zK})8!7&DfUZP%USQh9h2>w;j81ra3ChTuyCEJ zVWa8Rnts#9%B@>iE_v;kuXb(Ewc1m&et)04)zH1OvHW zyu3BvFvqMa)II%MRz!48aEY4Rujic%D_4JdtZ2e^yK_?Nm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asF2* zk$`lg(J6RtoX8ZsI|=GTb^oEw#s+CYWiatn0?EPz1?HNnN+uJLFde*_hNi0q1W(Y= zfWS31i4a$WjuymChvbSNxZ$-4nxtR*O=twatsMT^Py9dbx1*D}hY0We|L6IgBcw6S zn?|>x5x1heRlz?h329DdaMQ*4c_ti4zCUN)WYCY|LE;Hp^^F1(wh~Jsf`2ZP|KE}M zhnD3*;*$Ok>HY`Cpt&(wcsj|*og2k}qoAN%^PyX3@gGm1|JBJKvj22$f5ExUU~Brj z4RK$7H!>2H+r8-AHuY`SxitXbId5TNgwwf7ith98f$a)0znH?3!eaWXphZ`r_uL9U|=eQS9m^176!hwjKkiEPjeE zukE>{3bU+T>ymFnHc_pTBSz9A%0N*4!DQHX?VJ?U4r@12U(jnY}nw{tdD$X=C8L&-|!Ofe$g zc*O}DX(`Z%8sP>`=6haaUS6SuQ<+iU@aRM+V>r)H`%dJ>83j3N_RXG(YxT}And|0F zk58|47Pt_uNM_bozMc)Uj@qf^?{a16?O1-Ff**?^AAiJAq{vJ6WX1NHG0E4Kuy2RE z1sdQrV{O1&{>%ubgIBZFgDU^pHxurO&F?Q-9;**d<;7lFmpS<;bGvdnHQkwzTQh~7 zc{MP=e^vL2I(d0z9_d1?nx5RZ%DHHn{I++(?jpnTQ{lI>qL(d}plf{4sA4xE=@s9t P&y5Af*5nD=<>G$;e_pqq literal 0 HcmV?d00001 diff --git a/res/player/player.png b/res/player/player.png deleted file mode 100644 index 49461d32e123255ccce41d1dc0b61803b0b8ff08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2142 zcmbVN3rrJd94|+#>+Y_!Fnr@H z8O%(lK)}h&g7`w&Gy@UP7?G(kapN%*Hy;rN0Rb5ig1h6;$cjRY$S2=N$i4h^5F3t z26XE6%z9NUf{_L>ij%2?*lIAbXdZ7xxYdMW=>!9$5@|Z4T-bNMRtV^Dxo};u3R0OO z39T+Viy{)U;?!7HIwr$~;bFiEE5Z^O2nGeL2ECC+ta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; + bgPos.x = fix16Sub(bgPos.x, BG_SPEED); + // bgPos.y = fix16Add(bgPos.y, BG_SPEED_NORM); + if(bgPos.x <= -BG_SIZE_F) bgPos.x = fix16Add(bgPos.x, BG_SIZE_F); + if(bgPos.y >= BG_SIZE_F) bgPos.y = fix16Sub(bgPos.y, BG_SIZE_F); } @@ -43,5 +45,5 @@ void loadBg(){ } void updateBg(){ - // scrollBg(); + scrollBg(); } \ No newline at end of file diff --git a/src/main.c b/src/main.c index 1fd341d..38c5d99 100644 --- a/src/main.c +++ b/src/main.c @@ -26,13 +26,15 @@ static void loadInternals(){ static void loadGame(){ loadBg(); loadTiles(); + loadPlayer(); loadChrome(); } static void updateGame(){ + updateTiles(); + updatePlayer(); updateBg(); updateChrome(); - updateTiles(); clock++; if(clock >= CLOCK_LIMIT) clock -= CLOCK_LIMIT; } diff --git a/src/player.h b/src/player.h index 4e3e7c9..53cb5c9 100644 --- a/src/player.h +++ b/src/player.h @@ -1,12 +1,13 @@ // player #define PLAYER_OFF FIX16(16) -#define PLAYER_INIT_X FIX16(32) -#define PLAYER_INIT_Y FIX16(32) +#define PLAYER_INIT_X FIX16(40) +#define PLAYER_INIT_Y FIX16(GAME_H / 2) struct playerStruct { - Vect2D_f16 pos; + Vect2D_f16 pos, vel; Sprite* image; + s16 clock; }; struct playerStruct player; @@ -14,19 +15,76 @@ struct playerStruct player; // spawn static void spawnPlayer(){ - player.pos.x = 0; - player.pos.y = 0; - player.image = SPR_addSprite(&reimu, + player.pos.x = PLAYER_INIT_X; + player.pos.y = PLAYER_INIT_Y; + player.image = SPR_addSprite(&nitori, fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)), fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)), TILE_ATTR(PAL1, 0, 0, 0)); } +// collision + +#define PLAYER_LIMIT_X FIX16(16) +#define PLAYER_LIMIT_W FIX16(GAME_W - 16) +#define PLAYER_LIMIT_Y FIX16(16) +#define PLAYER_LIMIT_H FIX16(GAME_H - 16) + +static void checkPlayerBounds(){ + if(player.pos.x < PLAYER_LIMIT_X) player.pos.x = PLAYER_LIMIT_X; + else if(player.pos.x > PLAYER_LIMIT_W) player.pos.x = PLAYER_LIMIT_W; + if(player.pos.y < PLAYER_LIMIT_Y) player.pos.y = PLAYER_LIMIT_Y; + else if(player.pos.y > PLAYER_LIMIT_H) player.pos.y = PLAYER_LIMIT_H; +} + +// movement + +#define PLAYER_SPEED FIX16(2) +#define PLAYER_SPEED_NORM FIX16(2 * 0.707) + +s16 playerFrame; + +static void movePlayer(){ + playerFrame = 0; + if(ctrl.left || ctrl.right || ctrl.up || ctrl.down){ + if(ctrl.left || ctrl.right){ + if(ctrl.up || ctrl.down){ + player.vel.x = ctrl.left ? -PLAYER_SPEED_NORM : PLAYER_SPEED_NORM; + player.vel.y = ctrl.up ? -PLAYER_SPEED_NORM : PLAYER_SPEED_NORM; + playerFrame = ctrl.up ? 2 : 1; + } else { + player.vel.x = ctrl.left ? -PLAYER_SPEED : PLAYER_SPEED; + player.vel.y = 0; + } + } else if(ctrl.up){ + player.vel.x = 0; + player.vel.y = -PLAYER_SPEED; + playerFrame = 2; + } else if(ctrl.down){ + player.vel.x = 0; + player.vel.y = PLAYER_SPEED; + playerFrame = 1; + } + if(player.vel.x != 0) player.pos.x = fix16Add(player.pos.x, player.vel.x); + if(player.vel.y != 0) player.pos.y = fix16Add(player.pos.y, player.vel.y); + checkPlayerBounds(); + } + SPR_setFrame(player.image, playerFrame); +} + + // loop -void loadPlayer(){} +void loadPlayer(){ + spawnPlayer(); +} void updatePlayer(){ - spawnPlayer(); + movePlayer(); + SPR_setPosition(player.image, + fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)), + fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF))); + player.clock++; + if(player.clock >= CLOCK_LIMIT) player.clock -= CLOCK_LIMIT; } \ No newline at end of file