Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #326 from ModusCreateOrg/325
Browse files Browse the repository at this point in the history
325
  • Loading branch information
jaygarcia authored Dec 17, 2017
2 parents 549ff60 + 9aa383b commit 446ba2e
Show file tree
Hide file tree
Showing 38 changed files with 1,446 additions and 310 deletions.
31 changes: 20 additions & 11 deletions Evade2/Attract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ static const char scout_text[] PROGMEM = "SCOUT";
static const char bomber_text[] PROGMEM = "BOMBER";
static const char assault_text[] PROGMEM = "ASSAULT";

static const char credits1[] PROGMEM = "CRAFTED BY:\nMODUS CREATE\nDECEMBER 2017.\nHAPPY HOLIDAYS!\n\nhttp://modus.co";
static const char credits2[] PROGMEM = "DESIGN and MUSIC:\nJAY GARCIA";
static const char credits1[] PROGMEM = "CRAFTED BY:\nMODUS CREATE\nDECEMBER 2017\n\n\nhttp://modus.co";
static const char credits2[] PROGMEM = "MUSIC and SFX:\nJAY GARCIA";
static const char credits3[] PROGMEM = "ART:\nMICHAEL TINTIUC\nJON VAN DALEN\nJD JONES\nJAY GARCIA";
static const char credits4[] PROGMEM = "PROGRAMMING:\nMIKE SCHWARTZ\nJAY GARCIA\nDELIO BRIGNOLI\nMICHAEL TINTIUC\nANDY DENNIS";
static const char credits4[] PROGMEM = "PROGRAMMING:\nMIKE SCHWARTZ\nJAY GARCIA\nMICHAEL TINTIUC\n";
static const char credits5[] PROGMEM = "PROGRAMMING:\nDELIO BRIGNOLI\nSETH LEMMONS\nANDY DENNIS";
static const char credits6[] PROGMEM = "PROGRAMMING:\nVADIM POPA\nLUCAS STILL\nGRGUR GRISOGONO";

const BYTE MAX_SCREEN = 2;
const BYTE MAX_CREDITS = 3;
const BYTE MAX_CREDITS = 5;

struct attract_data {
BYTE screen;
Expand Down Expand Up @@ -66,9 +68,12 @@ static void init_screen(attract_data *ad, BYTE x = 6, BYTE y = 6) {
case 3:
ad->text = credits4;
break;
// case 4:
// ad->text = credits5;
// break;
case 4:
ad->text = credits5;
break;
case 5:
ad->text = credits6;
break;
}
}

Expand All @@ -81,7 +86,6 @@ static void init_screen(attract_data *ad, BYTE x = 6, BYTE y = 6) {

void Attract::next(Process *me, Object *o) {
attract_data *ad = (attract_data *)&o->x;
Sound::play_sound(SFX_ENEMY_SHOOT);

ad->timer--;
if (ad->timer < 0) {
Expand All @@ -92,6 +96,7 @@ void Attract::next(Process *me, Object *o) {
return;
}
else {
Sound::play_sound(SFX_NEXT_ATTRACT_SCREEN);
init_screen(ad);
me->sleep(1, typewriter);
}
Expand Down Expand Up @@ -125,13 +130,15 @@ void Attract::typewriter(Process *me, Object *o) {
}
ad->timer = TYPEWRITER_SPEED;
ad->offset++;
Sound::play_sound(SFX_NEXT_ATTRACT_CHAR);

}

if (ad->enemy != -1) {
Graphics::drawVectorGraphic(Enemy::enemy_graphic(ad->enemy), 64.0, 24.0, 0.0, 2.0);
}
if (game_mode == MODE_CREDITS) {
Font::scale = .7 * 256;
Font::scale = .85 * 256;
}
PGM_P p = ad->text;
BYTE x = ad->x, y = ad->y;
Expand All @@ -154,15 +161,17 @@ void Attract::typewriter(Process *me, Object *o) {
i++;
}
}
if (game_mode == MODE_CREDITS) {
// if (game_mode == MODE_CREDITS) {
Font::scale = 0x100;
}
// }
me->sleep(1);
}

void Attract::entry(Process *me, Object *o) {
attract_data *ad = (attract_data *)&o->x;
ad->screen = 0;
init_screen(ad);
Sound::play_sound(SFX_NEXT_ATTRACT_SCREEN);

me->sleep(1, typewriter);
}
13 changes: 7 additions & 6 deletions Evade2/Boss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ void Boss::explode(Process *me, Object *o) {
// Done exploding, move forward to the next wave
if (o->state > NUM_FRAMES) {
game_mode = MODE_NEXT_WAVE;
Game::kills = 120;
Game::kills = 65;
Camera::vz = CAMERA_VZ;
Sound::play_score(NEXT_WAVE_SONG);

ProcessManager::birth(Game::next_wave);
me->suicide();
Expand Down Expand Up @@ -274,7 +275,7 @@ void Boss::start_action(Process *me, Object *o) {
else {
me->sleep(1);
}
}
}
else {
o->y = Camera::y;
o->z = Camera::z + z_dist;
Expand Down Expand Up @@ -302,12 +303,12 @@ void Boss::start_action(Process *me, Object *o) {
}

void Boss::entry(Process *me, Object *o) {
// Debugging
// Boss::boss_type = 1;

// production
Boss::boss_type = random(1, 3);

// Debugging
// Boss::boss_type = 1;

game_mode = MODE_NEXT_WAVE;
Game::kills = 0;
Camera::vz = -20;
Expand Down Expand Up @@ -339,7 +340,7 @@ void Boss::entry(Process *me, Object *o) {
init_orbit(o, random() & 1);
Sound::play_score(STAGE_2_BOSS_SONG);
}
else {
else {
o->x = Camera::x - 512;
o->vx = +10;
o->vy = random(-3, 3);
Expand Down
6 changes: 2 additions & 4 deletions Evade2/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ void Game::next_wave(Process *me, Object *o) {
Font::printf(26, alert_top, "START WAVE %d", Game::wave + 1);
Font::scale = 256;
Player::recharge_shield();

Sound::play_score(GET_READY_SONG);
me->sleep(1);
}
}
Expand Down Expand Up @@ -142,8 +140,8 @@ void Game::get_ready(Process *me, Object *o) {

void Game::entry(Process *me, Object *o) {
game_data *d = (game_data *)&o->x;
d->timer = 60;
d->timer = 65;
d->theta = 90;
Sound::play_score(GET_READY_SONG);
Sound::play_score(NEXT_WAVE_SONG);
me->sleep(1, get_ready);
}
13 changes: 8 additions & 5 deletions Evade2/Sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ static Arduboy2Audio audio;
// Todo change to <ATMLib.h> once we publish
#include "sound/SFX.h"
#include "sound/evade2_00_intro.h"
#include "sound/evade2_00_intro_alt_smaller.h"
#include "sound/evade2_01_stage_1.h"
// #include "sound/evade2_01_stage_1.h"
#include "sound/evade2_01_stage_1_alt_smaller.h"
#include "sound/evade2_02_stage_1_boss.h"
#include "sound/evade2_03_stage_2_alt_smaller.h"
#include "sound/evade2_04_stage_2_boss.h"

#include "sound/evade2_05_stage_3.h"
#include "sound/evade2_06_stage_3_boss.h"

// #include "sound/evade2_07_stage_4.h"
// #include "sound/evade2_08_stage_4_boss_new.h"
#include "sound/evade2_10_game_over.h"
#include "sound/evade2_11_get_ready.h"
#include "sound/evade2_12_next_wave.h"

BYTE current_song = -1;

Expand All @@ -44,6 +45,8 @@ void Sound::play_sound(BYTE id) {
(UBYTE *)&SFX_player_shoot,
(UBYTE *)&SFX_enemy_shoot,
(UBYTE *)&SFX_player_hit,
(UBYTE *)&SFX_next_attract_screen,
(UBYTE *)&SFX_next_attract_char
};

atm_synth_stop_sfx_track(&sfx_state);
Expand All @@ -66,8 +69,7 @@ void Sound::stfu() {

void Sound::play_score(BYTE id) {
static const PROGMEM UBYTE *const songs[] = {
(UBYTE *)&evade2_00_intro_alt_smaller, // 0 INTRO_SONG
// (UBYTE *)&evade2_01_stage_1, // 1 STAGE_1_SONG
(UBYTE *)&evade2_00_intro, // 0 INTRO_SONG
(UBYTE *)&evade2_01_stage_1_alt_smaller, // 1 STAGE_1_SONG
(UBYTE *)&evade2_02_stage_1_boss, // 2 STAGE_1_BOSS_SONG
(UBYTE *)&evade2_03_stage_2_alt_smaller, // 3 STAGE_2_SONG
Expand All @@ -76,6 +78,7 @@ void Sound::play_score(BYTE id) {
(UBYTE *)&evade2_06_stage_3_boss, // 6 STAGE_3_BOSS_SONG
(UBYTE *)&evade2_10_game_over, // 7 GAME_OVER_SONG
(UBYTE *)&evade2_11_get_ready, // 8 GET_READY_SONG
(UBYTE *)&evade2_12_next_wave, // 9 NEXT_WAVE_SONG
};

if (current_song == id) {
Expand Down
9 changes: 3 additions & 6 deletions Evade2/Sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
const BYTE SFX_PLAYER_SHOOT = 0;
const BYTE SFX_ENEMY_SHOOT = 1;
const BYTE SFX_PLAYER_HIT_BY_ENEMY = 2;
const BYTE SFX_NEXT_ATTRACT_SCREEN = 3;
const BYTE SFX_NEXT_ATTRACT_CHAR = 4;

// SONGS
const BYTE INTRO_SONG = 0;
Expand All @@ -15,14 +17,9 @@ const BYTE STAGE_2_SONG = 3;
const BYTE STAGE_2_BOSS_SONG = 4;
const BYTE STAGE_3_SONG = 5;
const BYTE STAGE_3_BOSS_SONG = 6;

#if 0
const BYTE STAGE_4_SONG = 7;
const BYTE STAGE_4_BOSS_SONG = 8;
#endif

const BYTE GAME_OVER_SONG = 7;
const BYTE GET_READY_SONG = 8;
const BYTE NEXT_WAVE_SONG = 9;

class Sound {
public:
Expand Down
34 changes: 13 additions & 21 deletions Evade2/img/boss_4_img.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
#ifndef BOSS_4_IMG_H
#define BOSS_4_IMG_H

// SVG Graphic source: svg_docs/output_from_ai/assault-1.svg
// Number bytes 59
// SVG Graphic source: svg_docs/output_from_ai/scout-2.svg
// Number bytes 67
const PROGMEM BYTE boss_4_img[] = {
128, // Width (128 px)
54, // Height (54 px)
14, // Number of rows of coords (14)
73, // Height (73 px)
8, // Number of rows of coords (8)
// x0, y0, x1, y1
-21, -27, 21, 16,
-21, 16, 21, -27,
21, -16, 11, -5,
11, -5, 21, 5,
-21, 5, -11, -5,
-11, -5, -21, -16,
-11, 27, -32, 5,
-32, 5, -21, -5,
11, 27, 32, 5,
32, 5, 21, -5,
-21, -16, -64, -16,
21, -16, 64, -16,
-11, 5, 0, 16,
0, 16, 11, 5,

-55, -37, -9, 9,
-64, 9, -37, -18,
-37, 0, 0, -37,
0, -37, 37, 0,
-55, 37, -9, -9,
55, -37, 9, 9,
64, 9, 37, -18,
55, 37, 9, -9,
};
#endif
#endif
33 changes: 33 additions & 0 deletions Evade2/sound/SFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,37 @@ const PROGMEM struct SFX_player_hit_data {
},
};



const PROGMEM struct SFX_next_attract_screen_data {
uint8_t fmt;
uint8_t pattern0[11];
} SFX_next_attract_screen = {
.fmt = ATM_SCORE_FMT_MINIMAL_MONO,
.pattern0 = {
ATM_CMD_M_SET_TEMPO(1),
ATM_CMD_M_SET_VOLUME(80),
ATM_CMD_I_NOTE_C5,
ATM_CMD_M_DELAY_TICKS(1),
ATM_CMD_I_NOTE_E5,
ATM_CMD_M_DELAY_TICKS(2),
ATM_CMD_I_STOP,
},
};


const PROGMEM struct SFX_next_attract_char_data {
uint8_t fmt;
uint8_t pattern0[11];
} SFX_next_attract_char = {
.fmt = ATM_SCORE_FMT_MINIMAL_MONO,
.pattern0 = {
ATM_CMD_M_SET_TEMPO(1),
ATM_CMD_M_SET_VOLUME(60),
ATM_CMD_I_NOTE_D5,
ATM_CMD_M_DELAY_TICKS(1),
ATM_CMD_I_STOP,
},
};

#endif
Loading

0 comments on commit 446ba2e

Please sign in to comment.