From 0b660e2d0729667242e4048b87a941cef0425322 Mon Sep 17 00:00:00 2001 From: thegouldfish Date: Sun, 3 Jun 2018 21:14:05 +0100 Subject: [PATCH] V0.2 update Includes the following: Added idle, critical and grow animations. Game cursor will return to the last place the user was on their turn. Player select screen has some extra infomation and will block starting a game if there are not enough players selected. Bug fixes for Current and Next not showing right. Bug fixes for single frame graphics courption on switching players. Added first pass box art (blue an black versions, both MegaDrive). Added the first pass of the tutorial. --- Atoms/Atoms.vcxproj | 2 + Atoms/Atoms.vcxproj.filters | 6 + Atoms/inc/TutorialState.h | 18 + Atoms/res/Sprite/Buttons.bmp | Bin 0 -> 1558 bytes Atoms/res/Sprite/players2.bmp | Bin 0 -> 13942 bytes Atoms/res/gfx.h | 2 + Atoms/res/gfx.res | 7 +- Atoms/res/gfx/atoms_anims2.bmp | Bin 0 -> 72694 bytes Atoms/res/gfx/tutorial.bmp | Bin 0 -> 35958 bytes Atoms/res/gfx/tutorial_backing2.bmp | Bin 0 -> 35958 bytes Atoms/res/sprite.h | 5 +- Atoms/res/sprite.res | 7 +- Atoms/src/AtomsGameState.c | 331 ++++++++++------ Atoms/src/PlayerSelectState.c | 194 ++++++--- Atoms/src/TutorialState.c | 589 ++++++++++++++++++++++++++++ Atoms/src/WinnerScreen.c | 2 +- 16 files changed, 974 insertions(+), 189 deletions(-) create mode 100644 Atoms/inc/TutorialState.h create mode 100644 Atoms/res/Sprite/Buttons.bmp create mode 100644 Atoms/res/Sprite/players2.bmp create mode 100644 Atoms/res/gfx/atoms_anims2.bmp create mode 100644 Atoms/res/gfx/tutorial.bmp create mode 100644 Atoms/res/gfx/tutorial_backing2.bmp create mode 100644 Atoms/src/TutorialState.c diff --git a/Atoms/Atoms.vcxproj b/Atoms/Atoms.vcxproj index adcb86a..7aad762 100644 --- a/Atoms/Atoms.vcxproj +++ b/Atoms/Atoms.vcxproj @@ -89,6 +89,7 @@ + @@ -112,6 +113,7 @@ + Text diff --git a/Atoms/Atoms.vcxproj.filters b/Atoms/Atoms.vcxproj.filters index c8ac779..f4f6a10 100644 --- a/Atoms/Atoms.vcxproj.filters +++ b/Atoms/Atoms.vcxproj.filters @@ -51,6 +51,9 @@ Header Files + + Header Files + @@ -91,6 +94,9 @@ Source Files + + Source Files + diff --git a/Atoms/inc/TutorialState.h b/Atoms/inc/TutorialState.h new file mode 100644 index 0000000..b02ead0 --- /dev/null +++ b/Atoms/inc/TutorialState.h @@ -0,0 +1,18 @@ +#ifndef TUTORIAL_STATE +#define TUTORIAL_STATE + +#include "SimpleState.h" + + + + +void TutorialStateStart(); +void TutorialStateUpdate(); +void TutorialStateEnd(); + + +extern SimpleState TutorialState; + + + +#endif \ No newline at end of file diff --git a/Atoms/res/Sprite/Buttons.bmp b/Atoms/res/Sprite/Buttons.bmp new file mode 100644 index 0000000000000000000000000000000000000000..f6364beb76cc085c1c763c3a5d7c2ec8d50f41e6 GIT binary patch literal 1558 zcmcJPJx;?w5QPVc;3$$UDnv_1%N6L6(xl-ONJuPAd;&_!6lv0=Pnjzq7l>4ArE`_N zLU?b+c5Lh<6$7(=yE~s}_9uRPy15dyH?;Tgcla&*LN3vY%m*UhiTO49^gaGQ_#BE1 zSFiGO_le#N12b8z*0O*2l045fa=6}O90Z(JJ+<>+&0sQVzB+R5rP)8JC$MoH5sK+1 z4P`e8VO!1g>A~}I3A&ChyiZF4;WgZ=2TRzZf?)X;!S`2Y4J!D|XXm8}Dheg1Q$H`HJ<%B6Xct z&#o^o>z;SmUCt$+t62+|zcnjcG}uz>UQsu!wO5kbITj2^dEb0E=$tzC636_{V!aNB zyWxy=WS!mBQtRD-&H(kZ5t8BcS{gL0tBu(EO7t; literal 0 HcmV?d00001 diff --git a/Atoms/res/Sprite/players2.bmp b/Atoms/res/Sprite/players2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a4b652646dadcdf1fc65031c5a5107f706c17109 GIT binary patch literal 13942 zcmdU#KZqpBmB#B18AqO@Mr+Az>ofu(k*hO`yXBB-odP*pl2Yd!Yql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> z?hN!fN1e~!lAn!cP$yOMn3Lt{IV;cHc^)HvMtSD`zVgh)GUElqGUElqN>}%SVWs!BG4n!3u`r7YSA{6u(HYf}!|Df)xzKFA}U^D1Ol(dtQd{%XEY6 zc^M*4>v<(AxN49+FGGAE+4C|)M)tf6fltkh3WhJuj0%Pi&5R0$kIjq}o&2z1s%G7vj~Zp-F=~{F$EZ;z9-~fv zSTI$?&%)k|9T|3ZYDAmJu(MPn+C+w(jT+G= zGVDy%h&GX7X0=8{hK&7Lvv$H}$Jz;-9cw3ScC4MS*|B!QW(U_&*x_{*`$LZXA;{ki!l+?2y9_`TUjUd5wJaUh}*|K6$EnULs$-(L8UE z4<2Zqr^sh7G|#JG9T=tuy9T!NZfxh>*v`ALop)n9?_%$ZMU%LX@uWA-Jn6wa>A^hd z!93~4_;BuvB}4u;ILz>W5N60>hMdjtMSQd$^N7kQGw{tbU;%ymcn^l8*0B$e)Ru2r za_(I-Xsbuf9;GLCNG0dKLzEu11A%!;kD8E^Aw6mbLZ0(v05a}A*$!?SabT35YzMcE zYzMcEYzMcE*&0SLaA&n-0CEoEgL4ocoP+q_9K;8Ag7~*(rz8XDw3JPmfieSS2JYYt zq`KXyK778?+PT_l`DCW$i-ndCCR#pw)bjOOhj%)>)ZvW|Pjz^;=; W17!xv43rrtGf-xr%)rk)1OEqW=asJj literal 0 HcmV?d00001 diff --git a/Atoms/res/gfx/tutorial.bmp b/Atoms/res/gfx/tutorial.bmp new file mode 100644 index 0000000000000000000000000000000000000000..7e9186e85b9adb76f7e43252a5127398b6a26b8c GIT binary patch literal 35958 zcmeI4Ka3nn6~^ZzG6JwkF1-l`vJDmjA`on330XQc!A2`hunB>)TM2?okXWri8(>RJ zG?HamtCppXi0%*$(Q0)jCm|*P>9{@bES8Gzy;raPbXU*x+C5bba@o^eU0u`loA13> zRb4%^Kl#}wznyUU1l#Z7_2UmFlfPsC!Q>m*BH{dZzA3M7i#pLD7my`3)|2Z+npthO(A&ug%HHFFg$BF6zyEZ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q@qq8(0 z-&2m=MJGx6L}tFb;$`$d)-Ns6hSJRXG0DAq_wH{%icV$Zo52C8ZQ%6>%+JSoy#cfH zePsFWMP}?g$j+yDJzX#(A1w$?oqYHD3HY9me&zTOzfXS3`Z@FVjF8;=jhPP}VBmiJ z95APT@A>>MdheE#_?R6p`q>w?bb!uk-)Y$WAyVw9K`|2!Ap9XLU`{?TMEVJpEmFZ; z9VsZwN3v;;;}nbvGV?ha3voXvP{1+qDGTkbg`ErVac=!w>mixVi-4}iNclWC@#fag z``djFVsk85P+Ek~na@YAL-O!kRD@3%NGu1I&XnO3Dz>H5a#VZ-$arq3NaOLCmp49U zWU?S_6p%l|dp>{vfv-3R+EI3+eq48S`uP#L03SCQY?}IoQ7s`9>sQ@vTHL#~%%1}= zn{DugQEl@PUsXNp-Q=Ar-i?pk(&Fj(%feOFgJ%c$UmaA>9sm`G$PS??@jY+L*Bn6- zHLQLF0TRy#FyX`g-O~_!f_HH64F8x;_<;QGX-GbD!hmlG`FQ>1`66MyC_vQb!g?+H zl4@{1_CG>>Fa#j$m*R`2Fd>)b13ow)8S}vdxZ=B;G`hktd;laq!0m*O7spi>-3JCv znOFN4`)P@55Q9eQ$@<^(Bwt|Q9(;|<4tB`)P4fkSs%f~7#*e{xnimqjMcA;*dkd!o zEYIf$kuE;}OXeNs@b@v(`iYP{#dn(e4C$98(cka%&9-uE<%ED^;gc|FVRQeIO~0)I zj-9V<;L+Gu`@x2U_yg~m($hxE%|q=6!Xr?b;v{XJF51$&?-Fn1AmOoMhw}YfS k8xgowqH*A~C`Qhw=Jof!txr(2;62~F$^Txz{{#L03!w#_2LJ#7 literal 0 HcmV?d00001 diff --git a/Atoms/res/gfx/tutorial_backing2.bmp b/Atoms/res/gfx/tutorial_backing2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9f6a0f9c72123a9de705c1bdcff49037cee77842 GIT binary patch literal 35958 zcmeI5&x;(#701VrbBNBtIjkH=t{Ug8AWO$w66r4p=%Pbz7EAtt5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1bfV$oUKyq#vA$VD18$m@P5S`RXIzVPJgmlmyh_ z7p`MApY_3!^BLM#{a8SkFJ{m+=c|u=$D#V!{>5EGlXOK5`{2m=bPUGl^1LYm;=hLu z*?rrgC5x}iicJ-;Zzk{G5v7vT5`EC}u?W|A{UuUhgca-I8@2Zy?p6_Na WEnGRhQs7E~D+R6;xKd!t3j7a#8K-Xm literal 0 HcmV?d00001 diff --git a/Atoms/res/sprite.h b/Atoms/res/sprite.h index 2fb0405..adb40cc 100644 --- a/Atoms/res/sprite.h +++ b/Atoms/res/sprite.h @@ -2,8 +2,9 @@ #define _RES_SPRITE_H_ extern const SpriteDefinition Cursor; -extern const SpriteDefinition profs_player; -extern const SpriteDefinition profs_robot; extern const SpriteDefinition playerselect_cursor; +extern const SpriteDefinition profs; +extern const SpriteDefinition robo_pal; +extern const SpriteDefinition controller; #endif // _RES_SPRITE_H_ diff --git a/Atoms/res/sprite.res b/Atoms/res/sprite.res index ac55316..9ab7e7f 100644 --- a/Atoms/res/sprite.res +++ b/Atoms/res/sprite.res @@ -1,5 +1,6 @@ // SPRITE ring_sprite "sprite/ring.png" 2 2 FAST 5 SPRITE Cursor "sprite/Cursor.bmp" 4 4 BEST 10 -SPRITE profs_player "sprite/Prof-players.bmp" 6 6 BEST 0 -SPRITE profs_robot "sprite/profs-robots.bmp" 6 6 BEST 0 -SPRITE playerselect_cursor "sprite/menuCursor.bmp" 6 10 BEST 0 \ No newline at end of file +SPRITE playerselect_cursor "sprite/menuCursor.bmp" 6 10 BEST 0 +SPRITE profs "sprite/players2.bmp" 6 6 NONE 0 +SPRITE robo_pal "sprite/ProfPalette.bmp" 6 6 BEST 0 +SPRITE controller "sprite/Buttons.bmp" 3 3 BEST 0 diff --git a/Atoms/src/AtomsGameState.c b/Atoms/src/AtomsGameState.c index ec25af6..3e0a193 100644 --- a/Atoms/src/AtomsGameState.c +++ b/Atoms/src/AtomsGameState.c @@ -12,9 +12,6 @@ int m_AtomTileStart; -int m_LastCursorX = 0; -int m_LastCursorY = 0; - int m_CursorX = 0; int m_CursorY = 0; @@ -50,6 +47,43 @@ int m_PlayerSetup[7]; #define SND_EXPLODE 69 + +typedef struct +{ + int Start; + int Count; + int FrameRate; + int Loop; +}anim; + +anim m_Animations[] = +{ + {1,4,2,0}, // Grow to 1 + {4,4,2,0 }, // Grow to 2 + {8,4,2,0 }, // Grow to 3 + + {13,5,2,1}, // Idle 1 + {19,5,2,1}, // Idle 2 + + {25,4,3,1}, // Crit 1 + {29,4,3,1}, // Crit 2 + {33,4,3,1}, // Crit 3 + + {37,4,2,0} // Explode +}; + + + +typedef struct +{ + int X; + int Y; +}Point; + + + + + struct GridSquare { int Player; @@ -60,10 +94,19 @@ struct GridSquare int Explode; int Animate; + int Frame; + int FrameCounter; } m_PlayerGrid[70]; + + + + +Point m_CursorPositions[7]; + + void GridSetup() { int i = 0; @@ -75,7 +118,6 @@ void GridSetup() { m_PlayerGrid[i].Player = 0; - if (y == 0 && x == 0) { m_PlayerGrid[i].MaxSize = 2; @@ -121,26 +163,61 @@ void GridSetup() void DrawAtom(int player, int x, int y, int size) { - int row = 0; - int column = 0; - if (player < 0) { player = 0; size = 0; } - u16 t = (3 * size) + (player * 3 * 18); - for (row = 0; row < 3; row++) + int startingFrame = 0; + int animate = m_PlayerGrid[(y * 10) + x].Animate; + if (animate >= 0) { - for (column = 0; column < 3; column++) + anim* details = &m_Animations[animate]; + m_PlayerGrid[(y * 10) + x].FrameCounter++; + + if (m_PlayerGrid[(y * 10) + x].FrameCounter > details->FrameRate) + { + m_PlayerGrid[(y * 10) + x].Frame++; + m_PlayerGrid[(y * 10) + x].FrameCounter = 0; + } + + if (m_PlayerGrid[(y * 10) + x].Frame >= details->Count) + { + if (details->Loop) + { + m_PlayerGrid[(y * 10) + x].Frame = 0; + } + else + { + m_PlayerGrid[(y * 10) + x].Animate = -1; + m_PlayerGrid[(y * 10) + x].Frame = details->Count -1; + } + } + startingFrame = (details->Start + m_PlayerGrid[(y * 10) + x].Frame); + } + else + { + if (size == 4) + { + startingFrame = 39; + } + else + { + startingFrame = size * 4; + } + } + + u16 t = (startingFrame * 3 * 6 * 3) + (player * 3); + for (int row = 0; row < 3; row++) + { + for (int column = 0; column < 3; column++) { u16 tile = m_AtomTileStart; if (size != 0) { tile += atoms.map->tilemap[t]; } - VDP_setTileMapXY(PLAN_A, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, tile), column + (x * 3), row + (y * 3)); t++; } @@ -160,6 +237,8 @@ void SetupGame() m_PlayerGrid[i].GrowSize = 0; m_PlayerGrid[i].Player = 0; m_PlayerGrid[i].Size = 0; + m_PlayerGrid[i].Animate = -1; + m_PlayerGrid[i].Frame = 0; } // Reset the Player @@ -170,17 +249,24 @@ void SetupGame() m_TurnCount = 0; - for (i = 0; i<7; i++) - { - - // Set each player to be human for now - //m_PlayerSetup[i] = 1; - m_Alive[i] = 0; + for (i = 0; i < 7; i++) + { + if (m_PlayerSetup[i]) + { + m_Alive[i] = 1; + } + else + { + m_Alive[i] = 0; + } if (m_CurrentPlayer == 0 && m_PlayerSetup[i] != 0) { m_CurrentPlayer = i; } + + m_CursorPositions[i].X = -1; + m_CursorPositions[i].Y = -1; } @@ -294,6 +380,50 @@ int SizeAtSquare(int x, int y) } + +void EnableLoopingAnims() +{ + int y = 0; + int x = 0; + for (y = 0; y < 7; y++) + { + for (x = 0; x < 10; x++) + { + if (m_PlayerGrid[(y * 10) + x].Player == m_CurrentPlayer) + { + int size = m_PlayerGrid[(y * 10) + x].Size; + if (size + 1 == m_PlayerGrid[(y * 10) + x].MaxSize) + { + m_PlayerGrid[(y * 10) + x].Animate = 4 + size; + } + else + { + m_PlayerGrid[(y * 10) + x].Animate = 2 + size; + } + + m_PlayerGrid[(y * 10) + x].Frame = 0; + m_PlayerGrid[(y * 10) + x].FrameCounter = 0; + } + } + } +} + +void DisableLoopingAnims() +{ + int y = 0; + int x = 0; + for (y = 0; y < 7; y++) + { + for (x = 0; x < 10; x++) + { + m_PlayerGrid[(y * 10) + x].Animate = -1; + m_PlayerGrid[(y * 10) + x].Frame = 0; + m_PlayerGrid[(y * 10) + x].FrameCounter = 0; + } + } +} + + void AnimateScreen() { u8 animating = 1; @@ -323,7 +453,9 @@ void AnimateScreen() done = 0; } + m_PlayerGrid[j].Size += m_PlayerGrid[j].GrowSize; + if (m_PlayerGrid[j].Size > m_PlayerGrid[j].MaxSize) { m_PlayerGrid[j].GrowSize = m_PlayerGrid[j].Size - m_PlayerGrid[j].MaxSize; @@ -333,12 +465,17 @@ void AnimateScreen() { m_PlayerGrid[j].GrowSize = 0; } + + m_PlayerGrid[j].Animate = m_PlayerGrid[j].Size - 1; } } - for (j = 0; j<7; j++) + if (m_TurnCount) { - m_Alive[j] = 0; + for (j = 0; j < 7; j++) + { + m_Alive[j] = 0; + } } for (y = 0; y < 7; y++) @@ -359,7 +496,10 @@ void AnimateScreen() allSame = 0; } - m_Alive[player]++; + if (m_TurnCount) + { + m_Alive[player]++; + } if (m_PlayerGrid[i].Changed) { @@ -371,6 +511,7 @@ void AnimateScreen() m_PlayerGrid[i].Changed = 1; m_PlayerGrid[i].Size = 5; exploded = 1; + m_PlayerGrid[i].Animate = 8; } else if (size == 5) { @@ -481,19 +622,8 @@ void AnimateScreen() } -u8 m_CurrentType = 0; -u8 m_CurrentId = 0; - -u8 m_NextType = 0; -u8 m_NextId = 0; - void UpdateUpNext() { - Sprite* prevCurrent = m_Current; - Sprite* prevNext = m_Next; - - u8 updateCurrent = FALSE; - u8 updateNext = FALSE; int next = m_CurrentPlayer; @@ -513,101 +643,45 @@ void UpdateUpNext() break; } - if (m_PlayerSetup[next] != 0) + if (m_PlayerSetup[next] != 0 && m_Alive[next]) { break; } } - - - if (m_CurrentPlayer != m_CurrentId) - { - updateCurrent = TRUE; - } - if (m_PlayerSetup[m_CurrentPlayer] == m_CurrentType) - { - updateCurrent = TRUE; - } - - if (next != m_NextId) - { - updateNext = TRUE; - } - if (m_PlayerSetup[next] == m_NextType) - { - updateNext = TRUE; - } - - if (updateCurrent) + if (m_PlayerSetup[m_CurrentPlayer] == 1) { - SPR_setVisibility(prevCurrent, HIDDEN); - if (m_PlayerSetup[m_CurrentPlayer] == 1) - { - m_Current = SPR_addSprite(&profs_player, 0, 0, TILE_ATTR(PAL2, TRUE, FALSE, FALSE)); - } - else - { - m_Current = SPR_addSprite(&profs_robot, 0, 0, TILE_ATTR(PAL3, TRUE, FALSE, FALSE)); - } - SPR_setPosition(m_Current, 2, 52); SPR_setAnim(m_Current, m_CurrentPlayer - 1); + SPR_setPalette(m_Current, PAL2); } + else if(m_PlayerSetup[m_CurrentPlayer] == 2) + { + SPR_setAnim(m_Current, m_CurrentPlayer -1 + 6); + SPR_setPalette(m_Current, PAL3); + } + if (next != -1) { - if (updateNext) + if (m_PlayerSetup[next] == 1) { - SPR_setVisibility(prevNext, HIDDEN); - if (m_PlayerSetup[next] == 1) - { - m_Next = SPR_addSprite(&profs_player, 0, 0, TILE_ATTR(PAL2, TRUE, FALSE, FALSE)); - } - else - { - m_Next = SPR_addSprite(&profs_robot, 0, 0, TILE_ATTR(PAL3, TRUE, FALSE, FALSE)); - } - SPR_setPosition(m_Next, 2, 124); SPR_setAnim(m_Next, next - 1); + SPR_setPalette(m_Next, PAL2); } - } - - if (updateCurrent && updateNext) - { - SPR_update(); - - //VDP_waitVSync(); - } - - - if (prevCurrent != NULL) - { - if (updateCurrent) + else if (m_PlayerSetup[next] == 2) { - SPR_releaseSprite(prevCurrent); - m_CurrentId = m_CurrentPlayer; - m_CurrentType = m_PlayerSetup[m_CurrentPlayer]; - } + SPR_setAnim(m_Next, next -1 + 6); + SPR_setPalette(m_Next, PAL3); + } } - - if (prevNext != NULL) - { - if (updateNext) - { - SPR_releaseSprite(prevNext); - m_NextId = next; - m_NextType = m_PlayerSetup[next]; - } - } - - - //SPR_update(); } + + void AtomGameStart() { @@ -659,8 +733,8 @@ void AtomGameStart() // prepare palettes memcpy(&palette[0], ingame_back.palette->data, 16 * 2); memcpy(&palette[16], atoms.palette->data, 16 * 2); - memcpy(&palette[32], profs_player.palette->data, 16 * 2); - memcpy(&palette[48], profs_robot.palette->data, 16 * 2); + memcpy(&palette[32], profs.palette->data, 16 * 2); + memcpy(&palette[48], robo_pal.palette->data, 16 * 2); GridSetup(); @@ -680,14 +754,11 @@ void AtomGameStart() - m_Current = NULL; - m_Next = NULL; - - m_CurrentType = -1; - m_CurrentId = -1; + m_Current = SPR_addSprite(&profs, 0, 0, TILE_ATTR(PAL2, TRUE, FALSE, FALSE)); + SPR_setPosition(m_Current, 2, 52); - m_NextType = -1; - m_NextId = -1; + m_Next = SPR_addSprite(&profs, 0, 0, TILE_ATTR(PAL2, TRUE, FALSE, FALSE)); + SPR_setPosition(m_Next, 2, 124); UpdateUpNext(); @@ -767,10 +838,6 @@ void AIInput() void PlayerInput() { - m_LastCursorX = m_CursorX; - m_LastCursorY = m_CursorY; - - UpdatePad(&m_Pad); if (m_Pad.Up == PAD_PRESSED) @@ -897,16 +964,27 @@ void AtomGameUpdate() case STATE_ANIMATE: { - wait = 3; + + wait = 4; + DisableLoopingAnims(); AnimateScreen(); break; } case STATE_ANIMATE_WAIT: { - wait--; + u8 animating = 0; + for (int i = 0; i < 70; i++) + { + if (m_PlayerGrid[i].Animate >= 0) + { + animating++; + } + } + + //wait--; - if (wait < 0) + if (!animating) { m_GameState = STATE_ANIMATE; } @@ -916,6 +994,10 @@ void AtomGameUpdate() case STATE_END_CHECK: { + m_CursorPositions[m_CurrentPlayer].X = m_CursorX; + m_CursorPositions[m_CurrentPlayer].Y = m_CursorY; + + CheckForFinished(); if (m_GameFinished) @@ -928,6 +1010,15 @@ void AtomGameUpdate() { SwitchPlayer(); UpdateUpNext(); + EnableLoopingAnims(); + + + if (m_CursorPositions[m_CurrentPlayer].X != -1 && m_CursorPositions[m_CurrentPlayer].Y != -1) + { + m_CursorX = m_CursorPositions[m_CurrentPlayer].X; + m_CursorY = m_CursorPositions[m_CurrentPlayer].Y; + } + m_GameState = STATE_PLAY; } } diff --git a/Atoms/src/PlayerSelectState.c b/Atoms/src/PlayerSelectState.c index 43ea53a..03939ed 100644 --- a/Atoms/src/PlayerSelectState.c +++ b/Atoms/src/PlayerSelectState.c @@ -6,17 +6,49 @@ #include "../inc/PadHelper.h" #include "../inc/AtomsGameState.h" #include "../inc/GameState.h" +#include "../inc/TutorialState.h" #include "../res/sound.h" -int m_PlayerType[6]; +#include + +int m_PlayerType[] = {1,2,0,0,0,0}; Sprite* m_Players[6]; Sprite* m_Cursor; +Sprite* m_Buttons[3]; + Pad m_PlayerSelectPad; int m_PlayerSelectCurrentlySelected; + +void UpdateStart() +{ + u8 playerCount = 0; + for (int i = 0; i < 6; i++) + { + if (m_PlayerType[i] > 0) + { + playerCount++; + } + } + + + if (playerCount >= 2) + { + SPR_setVisibility(m_Buttons[2], VISIBLE); + VDP_drawText("to", 34, 24); + VDP_drawText("start", 34, 25); + } + else + { + SPR_setVisibility(m_Buttons[2], HIDDEN); + VDP_clearTextArea(34, 24, 6, 2); + } +} + + void MoveCursor() { switch (m_PlayerSelectCurrentlySelected) @@ -51,79 +83,33 @@ void MoveCursor() void ChangePlayer(int id, int type) { - if (m_Players[id] != 0) - { - SPR_releaseSprite(m_Players[id]); - } - switch (type) { case 0: { - m_Players[id] = 0; + SPR_setVisibility(m_Players[id], HIDDEN); return; } case 1: { - m_Players[id] = SPR_addSprite(&profs_player, 0, 0, TILE_ATTR(PAL2, TRUE, FALSE, FALSE)); - break; - } - - - case 2: - { - m_Players[id] = SPR_addSprite(&profs_robot, 0, 0, TILE_ATTR(PAL3, TRUE, FALSE, FALSE)); - break; - } - } + + SPR_setAnim(m_Players[id], id); + SPR_setPalette(m_Players[id], PAL2); - SPR_setVisibility(m_Players[id], HIDDEN); - - SPR_setAnim(m_Players[id], id); - - switch (id) - { - case 0: - { - SPR_setPosition(m_Players[id], 41, 9); - break; - } - - case 1: - { - SPR_setPosition(m_Players[id], 130, 9); + SPR_setVisibility(m_Players[id], VISIBLE); break; } case 2: { - SPR_setPosition(m_Players[id], 219, 9); - break; - } - - case 3: - { - SPR_setPosition(m_Players[id], 41, 98); - break; - } - - case 4: - { - SPR_setPosition(m_Players[id], 130, 98); - break; - } - - case 5: - { - SPR_setPosition(m_Players[id], 219, 98); + + SPR_setAnim(m_Players[id], id + 6); + SPR_setPalette(m_Players[id], PAL3); break; } } - - - SPR_setVisibility(m_Players[id], VISIBLE); } @@ -152,35 +138,104 @@ void PlayerSelectStart() SYS_enableInts(); + + /* m_PlayerType[0] = 1; m_PlayerType[1] = 2; m_PlayerType[2] = 0; m_PlayerType[3] = 0; m_PlayerType[4] = 0; m_PlayerType[5] = 0; + */ - - for (int i = 0; i < 6; i++) + int i = 0; + for (i = 0; i < 6; i++) { - m_Players[i] = 0; + m_Players[i] = SPR_addSprite(&profs, 0, 0, TILE_ATTR(PAL2, TRUE, FALSE, FALSE)); + + switch (i) + { + case 0: + { + SPR_setPosition(m_Players[i], 41, 9); + break; + } + + case 1: + { + SPR_setPosition(m_Players[i], 130, 9); + break; + } + + + case 2: + { + SPR_setPosition(m_Players[i], 219, 9); + break; + } + + case 3: + { + SPR_setPosition(m_Players[i], 41, 98); + break; + } + + case 4: + { + SPR_setPosition(m_Players[i], 130, 98); + break; + } + + case 5: + { + SPR_setPosition(m_Players[i], 219, 98); + break; + } + } + + ChangePlayer(i, m_PlayerType[i]); + + } m_Cursor = SPR_addSprite(&playerselect_cursor, 0, 0, TILE_ATTR(PAL1, TRUE, FALSE, FALSE)); SPR_setPosition(m_Cursor, 41, 4); + for (i = 0; i < 3; i++) + { + m_Buttons[i] = SPR_addSprite(&controller, 0, 0, TILE_ATTR(PAL1, TRUE, FALSE, FALSE)); + } + + + SPR_setFrame(m_Buttons[0], 0); + SPR_setPosition(m_Buttons[0], 0, 188); + + SPR_setFrame(m_Buttons[1], 2); + SPR_setPosition(m_Buttons[1], 136, 188); + + SPR_setFrame(m_Buttons[2], 3); + SPR_setPosition(m_Buttons[2], 242, 188); VDP_setTextPalette(PAL0); + VDP_drawText("to change",4,24); + VDP_drawText("player", 4, 25); + + VDP_drawText("for", 20, 24); + VDP_drawText("tutorial", 20, 25); + + UpdateStart(); u16 palette[64]; memcpy(&palette[0], playerselect_background.palette->data, 16 * 2); memcpy(&palette[16], playerselect_stands_background.palette->data, 16 * 2); - memcpy(&palette[32], profs_player.palette->data, 16 * 2); - memcpy(&palette[48], profs_robot.palette->data, 16 * 2); + + memcpy(&palette[32], profs.palette->data, 16 * 2); + memcpy(&palette[48], robo_pal.palette->data, 16 * 2); m_PlayerSelectCurrentlySelected = 0; SetupPad(&m_PlayerSelectPad, JOY_1); @@ -203,6 +258,7 @@ void PlayerSelectStart() + void PlayerSelectUpdate() { UpdatePad(&m_PlayerSelectPad); @@ -273,11 +329,20 @@ void PlayerSelectUpdate() } ChangePlayer(m_PlayerSelectCurrentlySelected, m_PlayerType[m_PlayerSelectCurrentlySelected]); + UpdateStart(); XGM_startPlayPCM(SND_CHANGE, 0, 2); } + if (m_PlayerSelectPad.C == PAD_PRESSED) + { + XGM_startPlayPCM(SND_START, 0, 2); + + StateMachineChange(&GameMachineState, &TutorialState); + } + + if (m_PlayerSelectPad.START == PAD_PRESSED) { @@ -291,7 +356,7 @@ void PlayerSelectUpdate() } } - if (willPlay) + if (willPlay >= 2) { m_PlayerSetup[0] = 0; for (int i = 1; i < 7; i++) @@ -331,6 +396,13 @@ void PlayerSelectEnd() SPR_releaseSprite(m_Cursor); + for (int i = 0; i < 3; i++) + { + SPR_releaseSprite(m_Buttons[i]); + } + + VDP_clearTextArea(0, 24, 40, 2); + SPR_update(); VDP_waitVSync(); } diff --git a/Atoms/src/TutorialState.c b/Atoms/src/TutorialState.c new file mode 100644 index 0000000..b99552e --- /dev/null +++ b/Atoms/src/TutorialState.c @@ -0,0 +1,589 @@ +#include + +#include "../inc/TutorialState.h" +#include "../res/gfx.h" +#include "../inc/GameState.h" +#include "../inc/PlayerSelectState.h" +#include "../inc/PadHelper.h" + +int m_PreviousState = 0; +Pad m_TutorialPad; +int m_AtomTileStart = 0; + +StateMachine m_TutorialMachine; + + + +void TutorialDrawAtom(int player, int x, int y, int size) +{ + int row = 0; + int column = 0; + + if (player < 0) + { + player = 0; + size = 0; + } + + + int startingFrame = 0; + + if (size == 4) + { + startingFrame = 37; + } + else + { + startingFrame = size * 4; + } + if (size == 5) + { + startingFrame = 41; + } + + + u16 t = (startingFrame * 3 * 6 * 3) + (player * 3); + for (row = 0; row < 3; row++) + { + for (column = 0; column < 3; column++) + { + + u16 tile = m_AtomTileStart; + if (size != 0) + { + tile += atoms.map->tilemap[t]; + } + + + + + VDP_setTileMapXY(PLAN_A, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, tile), column + (x * 3) + 7, row + (y * 3) + 3); + t++; + } + t += 15; + } +} + + + + +SimpleState Part1; +SimpleState Part2; +SimpleState Part3; +SimpleState Part4; +SimpleState Part5; +SimpleState Part6; +SimpleState Part7; +SimpleState Part8; +SimpleState Part9; +SimpleState Part10; +SimpleState Part11; + +void Part1Start() +{ + // Set palette to black + VDP_setPaletteColors(0, (u16*)palette_black, 64); + + SYS_disableInts(); + + int ind = TILE_USERINDEX; + + VDP_clearTextArea(0, 0, 40, 28); + + //VDP_setPalette(PAL0, ingame_back.palette->data); + VDP_drawImageEx(PLAN_B, &tutorial_backing, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, ind), 0, 0, FALSE, DMA); + ind += tutorial_backing.tileset->numTile; + + VDP_setPalette(PAL0, tutorial_backing.palette->data); + + + SYS_enableInts(); + + VDP_setVerticalScroll(PLAN_A, -4); + VDP_setHorizontalScroll(PLAN_A, 4); + + + VDP_drawText("Welcome to MegaAtoms!", 14, 5); + VDP_drawText("I'm professor Loggy", 14, 7); + VDP_drawText("I will teach you", 14, 8); + VDP_drawText("how to play!", 14, 9); + + VDP_drawText("Press A to move on", 14, 13); + VDP_drawText("Press B to move back", 14, 14); + VDP_drawText("Press C to quit", 14, 15); + +} + +void Part1Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + m_PreviousState = 1; + StateMachineChange(&m_TutorialMachine, &Part2); + } +} + +void Part1End() +{ +} + +SimpleState Part1 = +{ + Part1Start, + Part1Update, + Part1End +}; + + + + + + +void Part2Start() +{ + + + if (m_PreviousState == 1) + { + // Set palette to black + VDP_setPaletteColors(0, (u16*)palette_black, 64); + + SYS_disableInts(); + + int ind = TILE_USERINDEX; + + VDP_clearTextArea(0, 0, 40, 28); + + //VDP_setPalette(PAL0, ingame_back.palette->data); + VDP_drawImageEx(PLAN_B, &tutorial_backing_2, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, ind), 0, 0, FALSE, DMA); + ind += tutorial_backing_2.tileset->numTile; + + VDP_setPalette(PAL0, tutorial_backing_2.palette->data); + + + VDP_setPalette(PAL1, atoms.palette->data); + VDP_loadTileSet(atoms.tileset, ind, CPU); + + m_AtomTileStart = ind; + ind += atoms.tileset->numTile; + + VDP_fillTileMapRect(PLAN_A, TILE_ATTR_FULL(PAL1, 0, 0, 0, m_AtomTileStart), 0, 0, 40, 28); + + + SYS_enableInts(); + } + + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("This is the game grid",4,25); + VDP_drawText("where all the action takes place", 4, 26); +} + +void Part2Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + m_PreviousState = 2; + StateMachineChange(&m_TutorialMachine, &Part3); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part1); + } +} + +void Part2End() +{ +} + +SimpleState Part2 = +{ + Part2Start, + Part2Update, + Part2End +}; + + + + +void Part3Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("each player takes it in turn", 4, 25); + VDP_drawText("to place atoms on the grid", 4, 26); + +} + +void Part3Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part4); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part2); + } +} +void Part3End() +{ +} + +SimpleState Part3 = +{ + Part3Start, + Part3Update, + Part3End +}; + + +int m_Part4Counter = 0; +void Part4Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("you place an atom on an empty", 4, 25); + VDP_drawText("square or can grow your own", 4, 26); + + TutorialDrawAtom(1, 3, 3, 1); + TutorialDrawAtom(3, 4, 4, 2); + + TutorialDrawAtom(0, 4, 3, 0); + m_Part4Counter = 0; +} +void Part4Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + m_Part4Counter++; + if (m_Part4Counter == 4) + { + StateMachineChange(&m_TutorialMachine, &Part5); + } + else + { + TutorialDrawAtom(0, 4, 3, m_Part4Counter); + } + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part3); + } +} +void Part4End() +{ +} + +SimpleState Part4 = +{ + Part4Start, + Part4Update, + Part4End +}; + + + +void Part5Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("When a square has too many", 4, 25); + VDP_drawText("atoms it will explode", 4, 26); + + TutorialDrawAtom(1, 3, 3, 1); + TutorialDrawAtom(3, 4, 4, 2); + TutorialDrawAtom(0, 4, 3, 4); +} +void Part5Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part6); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part4); + } +} +void Part5End() +{ +} +SimpleState Part5 = +{ + Part5Start, + Part5Update, + Part5End +}; + + + + +void Part6Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("This will capture the squares", 4, 25); + VDP_drawText("around it and grow them", 4, 26); + + TutorialDrawAtom(0, 3, 3, 2); + TutorialDrawAtom(0, 4, 4, 3); + TutorialDrawAtom(0, 4, 3, 0); +} + +void Part6Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part7); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part5); + } +} + +void Part6End() +{ +} + +SimpleState Part6 = +{ + Part6Start, + Part6Update, + Part6End +}; + + + + +void Part7Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("the number of atoms needed", 4, 25); + VDP_drawText("to explode can be seen above", 4, 26); + + int x, y = 0; + for (y = 0; y<7; y++) + { + for (x = 0; x<10; x++) + { + if (y == 0 && x == 0) + { + TutorialDrawAtom(0, x, y, 2); + } + else if (y == 0 && x == 9) + { + TutorialDrawAtom(0, x, y, 2); + } + else if (y == 0) + { + TutorialDrawAtom(0, x, y, 3); + } + else if (y == 6 && x == 0) + { + TutorialDrawAtom(0, x, y, 2); + } + else if (x == 0) + { + TutorialDrawAtom(0, x, y, 3); + } + else if (y == 6 && x == 9) + { + TutorialDrawAtom(0, x, y, 2); + } + else if (y == 6) + { + TutorialDrawAtom(0, x, y, 3); + } + else if (x == 9) + { + TutorialDrawAtom(0, x, y, 3); + } + else + { + TutorialDrawAtom(0, x, y, 5); + } + } + } + +} + +void Part7Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part8); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part6); + } +} +void Part7End() +{ +} +SimpleState Part7 = +{ + Part7Start, + Part7Update, + Part7End +}; + + +void Part8Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("exploding atoms is the only", 4, 25); + VDP_drawText("way to capture opponents atoms", 4, 26); + +} +void Part8Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part9); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part7); + } +} +void Part8End() +{ +} + +SimpleState Part8 = +{ + Part8Start, + Part8Update, + Part8End +}; + + + +void Part9Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("you need to do this as you win", 4, 25); + VDP_drawText("when you are the last player", 4, 26); +} +void Part9Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part10); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part8); + } +} +void Part9End() +{ +} +SimpleState Part9 = +{ + Part9Start, + Part9Update, + Part9End +}; + + + +void Part10Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("Use chain reactions to capture", 4, 25); + VDP_drawText("large areas in a single turn", 4, 26); +} +void Part10Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part11); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part9); + } +} +void Part10End() +{ +} +SimpleState Part10 = +{ + Part10Start, + Part10Update, + Part10End +}; + + + +void Part11Start() +{ + VDP_clearTextArea(0, 0, 40, 28); + VDP_drawText("Press A to start again", 4, 25); + VDP_drawText("Press C to leave", 4, 26); +} +void Part11Update() +{ + if (m_TutorialPad.A == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part1); + } + else if (m_TutorialPad.B == PAD_PRESSED) + { + StateMachineChange(&m_TutorialMachine, &Part10); + } +} +void Part11End() +{ +} +SimpleState Part11 = +{ + Part11Start, + Part11Update, + Part11End +}; + + + + + + + + + + + + +void TutorialStateStart() +{ + SetupPad(&m_TutorialPad, JOY_1); + StateMachineStart(&m_TutorialMachine, &Part1); +} + + +void TutorialStateUpdate() +{ + UpdatePad(&m_TutorialPad); + + + if (m_TutorialPad.C == PAD_PRESSED) + { + StateMachineChange(&GameMachineState, &PlayerSelectState); + return; + } + + StateMachineUpdate(&m_TutorialMachine); +} + + +void TutorialStateEnd() +{ + VDP_fadeOut(0, 64, 20, FALSE); +} + + +SimpleState TutorialState = +{ + TutorialStateStart, + TutorialStateUpdate, + TutorialStateEnd +}; \ No newline at end of file diff --git a/Atoms/src/WinnerScreen.c b/Atoms/src/WinnerScreen.c index 73c1bf4..d0e9424 100644 --- a/Atoms/src/WinnerScreen.c +++ b/Atoms/src/WinnerScreen.c @@ -23,7 +23,7 @@ void WinnerScreenStart() //VDP_setPalette(PAL0, ingame_back.palette->data); - VDP_drawImageEx(PLAN_B, &winner_background, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, ind), 0, 0, FALSE, DMA); + VDP_drawImageEx(PLAN_B, &winner_background, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, ind), 0, 0, FALSE, CPU); ind += winner_background.tileset->numTile;