From 11655c8ef4aed8f3adca4079fb95a8b25109229e Mon Sep 17 00:00:00 2001 From: Ritbulau <94283288+Ritbulau@users.noreply.github.com> Date: Mon, 29 May 2023 15:39:28 +0300 Subject: [PATCH] Doom Nano Brutality v1.4 The lore update --- README.md => doom-nano-brutality/README.md | 0 .../SSD1306.cpp | 0 SSD1306.h => doom-nano-brutality/SSD1306.h | 0 .../TWI_Master.cpp | 0 .../TWI_Master.h | 0 .../constants.h | 0 display.h => doom-nano-brutality/display.h | 0 .../doom-nano-brutality.ino | 59 ++++++++++--------- .../entities.cpp | 0 entities.h => doom-nano-brutality/entities.h | 0 input.cpp => doom-nano-brutality/input.cpp | 0 level.h => doom-nano-brutality/level.h | 0 sound.h => doom-nano-brutality/sound.h | 14 +---- sprites.h => doom-nano-brutality/sprites.h | 0 types.cpp => doom-nano-brutality/types.cpp | 0 types.h => doom-nano-brutality/types.h | 0 16 files changed, 34 insertions(+), 39 deletions(-) rename README.md => doom-nano-brutality/README.md (100%) rename SSD1306.cpp => doom-nano-brutality/SSD1306.cpp (100%) rename SSD1306.h => doom-nano-brutality/SSD1306.h (100%) rename TWI_Master.cpp => doom-nano-brutality/TWI_Master.cpp (100%) rename TWI_Master.h => doom-nano-brutality/TWI_Master.h (100%) rename constants.h => doom-nano-brutality/constants.h (100%) rename display.h => doom-nano-brutality/display.h (100%) rename doom-nano-brutality.ino => doom-nano-brutality/doom-nano-brutality.ino (94%) rename entities.cpp => doom-nano-brutality/entities.cpp (100%) rename entities.h => doom-nano-brutality/entities.h (100%) rename input.cpp => doom-nano-brutality/input.cpp (100%) rename level.h => doom-nano-brutality/level.h (100%) rename sound.h => doom-nano-brutality/sound.h (96%) rename sprites.h => doom-nano-brutality/sprites.h (100%) rename types.cpp => doom-nano-brutality/types.cpp (100%) rename types.h => doom-nano-brutality/types.h (100%) diff --git a/README.md b/doom-nano-brutality/README.md similarity index 100% rename from README.md rename to doom-nano-brutality/README.md diff --git a/SSD1306.cpp b/doom-nano-brutality/SSD1306.cpp similarity index 100% rename from SSD1306.cpp rename to doom-nano-brutality/SSD1306.cpp diff --git a/SSD1306.h b/doom-nano-brutality/SSD1306.h similarity index 100% rename from SSD1306.h rename to doom-nano-brutality/SSD1306.h diff --git a/TWI_Master.cpp b/doom-nano-brutality/TWI_Master.cpp similarity index 100% rename from TWI_Master.cpp rename to doom-nano-brutality/TWI_Master.cpp diff --git a/TWI_Master.h b/doom-nano-brutality/TWI_Master.h similarity index 100% rename from TWI_Master.h rename to doom-nano-brutality/TWI_Master.h diff --git a/constants.h b/doom-nano-brutality/constants.h similarity index 100% rename from constants.h rename to doom-nano-brutality/constants.h diff --git a/display.h b/doom-nano-brutality/display.h similarity index 100% rename from display.h rename to doom-nano-brutality/display.h diff --git a/doom-nano-brutality.ino b/doom-nano-brutality/doom-nano-brutality.ino similarity index 94% rename from doom-nano-brutality.ino rename to doom-nano-brutality/doom-nano-brutality.ino index a64bd85..f3df055 100644 --- a/doom-nano-brutality.ino +++ b/doom-nano-brutality/doom-nano-brutality.ino @@ -232,7 +232,7 @@ UID detectCollision(const uint8_t level[], Coords *pos, double relative_x, doubl uint8_t round_y = int(pos->y + relative_y); uint8_t block = getBlockAt(level, round_x, round_y); - if (block == E_WALL) { + if (block == E_WALL & debug == false) { playSound(hit_wall_snd, HIT_WALL_SND_LEN); return create_uid(block, round_x, round_y); } @@ -890,7 +890,7 @@ void updateHud() { display.clearRect(12, 58, 100, 6); display.clearRect(50, 58, 15, 6); display.clearRect(58, 58, 70, 6); - + if (z == 1) { drawText(31, 58, F("FOUND ")); drawText(65, 58, F(" SHELLS")); @@ -980,35 +980,40 @@ void loopMid() { getControllerData(); #endif if (mid == 1) { - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .14, F("YOU ARE THE DOOM GUY, AND")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .23, F("YOU ARE WITNESSING FAILED")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .32, F("UAC EXPIREMENT ON MARS.")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .42, F("WHEN DEMONS STARTED")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .51, F("ENTERING OUR WORLD, YOU")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .60, F("WERE ON UAC MARS DEMON")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .70, F("SHOOTING FACILITY, YOU ")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .80, F("HAVE TO GET OUT OF HERE.")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .14, F("YEAR 2027. HUMANS REACHED")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .23, F("OTHER PLANETS, BUT WE ARE")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .32, F("NOT ALONE, THERE IS ALSO")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .42, F("HOSTILE ALIENS HERE. YOU")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .51, F("ARE AN UNKNOWN MARINE,")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .60, F("WHO FIGHT IN OLD LAB FOR")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .70, F("REMNANTS OF EARTH. RESIST")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .80, F("ALIENS TO ESCAPE.")); } else if (mid == 2){ - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .16, F("AFTER KILLING BUNCH OF ")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .28, F("IMPS, LIGHTS TURNED OFF")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .40, F("AND A TELEPORT OPENED IN")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .52, F("FRONT OF YOU. YOU HAD NO")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .64, F("CHOISE AND STEPPED IN...")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .14, F("AFTER KILLING BUNCH OF ")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .23, F("ALIENS, LIGHTS TURNED OFF")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .32, F("AND THE FLOOR COLLAPSED")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .42, F("UNDER YOUR FEET AND YOU ")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .51, F("FELL INTO THE UTILITY")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .60, F("ROOMS. YOU HAVE NO CHOICE")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .70, F("BUT TO START LOOKING FOR ")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .80, F("EXIT, WHILE FIGHT ALIENS.")); + levelID = true; } else { - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .14, F("AFTER HARD FIGHT YOU WENT")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .23, F("TO EXIT. YOU ACTIVATED")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .32, F("YOUR HELMET AND STEPPED")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .42, F("OUT TO MARS SURFACE WITH")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .51, F("SPACESHIP AND ANOTHER")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .60, F("FACILITY IN THE DISTANCE.")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .70, F("FIN. TO BE CONTINIED...")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .14, F("AFTER HARD FIGHT YOU WENT")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .23, F("TO EXIT. AND AS SOON AS")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .32, F("YOU STEP OUT, AN ALIEN")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .42, F("ATTACKS YOU FROM BEHIND")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .51, F("AND KILLS YOU. YOU DIDNT")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .60, F("EXPECT THIS. YOUR FIGHT")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .70, F("CAN NOT END LIKE THIS...")); + drawText(SCREEN_WIDTH / 4.6 - 26, SCREEN_HEIGHT * .80, F("THE END (MAYBE...)")); } - drawText(SCREEN_WIDTH / 2.1 - 25, SCREEN_HEIGHT * .01, F("THE STORY")); - drawText(SCREEN_WIDTH / 2 - 25, SCREEN_HEIGHT * .91, F("PRESS FIRE")); + drawText(SCREEN_WIDTH / 2.1 - 24, SCREEN_HEIGHT * .01, F("THE STORY")); + drawText(SCREEN_WIDTH / 2 - 27, SCREEN_HEIGHT * .91, F("PRESS FIRE")); display.display(); while (!exit_scene) { @@ -1088,7 +1093,7 @@ void loopScore() { else if (player.cheats == true) { drawText(SCREEN_WIDTH / 0.99 - 49, SCREEN_HEIGHT * .4, F("NO SCORE")); drawText(SCREEN_WIDTH / 0.99 - 37, SCREEN_HEIGHT * .5, F("FOR")); - drawText(SCREEN_WIDTH / 0.99 - 49, SCREEN_HEIGHT * .6, F("CHEATERS")); + drawText(SCREEN_WIDTH / 0.99 - 49, SCREEN_HEIGHT * .6, F("CHEESERS")); drawText(SCREEN_WIDTH / 0.99 - 52, SCREEN_HEIGHT * .91, F("PRESS FIRE")); if (input_fire()) { display.clearRect(1, 1, 127, 63); @@ -1136,7 +1141,7 @@ void loopIntro() { drawText(SCREEN_WIDTH / 2.36 - 25, SCREEN_HEIGHT * .79, F("NANO BRUTALITY")); drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .3, F("PRESS")); drawText(SCREEN_WIDTH / 0.99 - 25, SCREEN_HEIGHT * .3, F("FIRE")); - drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .91, F("V 1.3")); + drawText(SCREEN_WIDTH / 4.6 - 25, SCREEN_HEIGHT * .91, F("V 1.4")); display.display(); playSound(mus_s1_snd, MUS_S1_SND_LEN); while (!exit_scene) { @@ -1701,5 +1706,3 @@ void loop(void) { // Stop (so it doesn't repeat forever driving you crazy--you're welcome). } - - diff --git a/entities.cpp b/doom-nano-brutality/entities.cpp similarity index 100% rename from entities.cpp rename to doom-nano-brutality/entities.cpp diff --git a/entities.h b/doom-nano-brutality/entities.h similarity index 100% rename from entities.h rename to doom-nano-brutality/entities.h diff --git a/input.cpp b/doom-nano-brutality/input.cpp similarity index 100% rename from input.cpp rename to doom-nano-brutality/input.cpp diff --git a/level.h b/doom-nano-brutality/level.h similarity index 100% rename from level.h rename to doom-nano-brutality/level.h diff --git a/sound.h b/doom-nano-brutality/sound.h similarity index 96% rename from sound.h rename to doom-nano-brutality/sound.h index 502a126..8a09dd8 100644 --- a/sound.h +++ b/doom-nano-brutality/sound.h @@ -82,12 +82,6 @@ constexpr uint8_t mus_p21_snd[] PROGMEM = {0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0 constexpr uint8_t MUS_P22_SND_LEN = 19; constexpr uint8_t mus_p22_snd[] PROGMEM = {0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - -//S1 - -constexpr uint8_t MUS_P23_SND_LEN = 19; -constexpr uint8_t mus_p23_snd[] PROGMEM = {0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - //S1 constexpr uint8_t MUS_P24_SND_LEN = 19; @@ -95,8 +89,6 @@ constexpr uint8_t mus_p24_snd[] PROGMEM = {0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0 //S1 -constexpr uint8_t MUS_P25_SND_LEN = 19; -constexpr uint8_t mus_p25_snd[] PROGMEM = {0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; constexpr uint8_t MUS_P26_SND_LEN = 19; constexpr uint8_t mus_p26_snd[] PROGMEM = {0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; @@ -298,13 +290,13 @@ ISR(TIMER2_COMPA_vect) { playSound(mus_p22_snd, MUS_P22_SND_LEN); } else if (music == 71 ) { - playSound(mus_p23_snd, MUS_P23_SND_LEN); + playSound(mus_p2_snd, MUS_P2_SND_LEN); } else if (music == 73) { playSound(mus_p24_snd, MUS_P24_SND_LEN); } else if (music == 75) { - playSound(mus_p25_snd, MUS_P25_SND_LEN); + playSound(mus_p2_snd, MUS_P2_SND_LEN); } else if (music == 76) { playSound(mus_p26_snd, MUS_P26_SND_LEN); @@ -334,4 +326,4 @@ ISR(TIMER2_COMPA_vect) { } } -#endif +#endif \ No newline at end of file diff --git a/sprites.h b/doom-nano-brutality/sprites.h similarity index 100% rename from sprites.h rename to doom-nano-brutality/sprites.h diff --git a/types.cpp b/doom-nano-brutality/types.cpp similarity index 100% rename from types.cpp rename to doom-nano-brutality/types.cpp diff --git a/types.h b/doom-nano-brutality/types.h similarity index 100% rename from types.h rename to doom-nano-brutality/types.h